Hide element (works but with delay)

FilMar

Member
I have a details form (read-only) with some elements.
One element is a status (hidden) and one a link field.

Depending the status I want to show hide the link element.

Now I took the status element and in the javascript part I entered 2 events:
On Load: if element 'Status' not regex 1|7 hide element 'xxx.link'
On Load: if element 'Status' regex 1|7 show element 'xxx.link'

It works fine, only when the form opens it first shows the link and then after a short delay it hides the link if the status is not 1 or 7.

How do I adapt the code that the link-element is directly hidden?

Many thanks in advance,

Filip
 
At the moment, you can't. I'd need to add another option to elements ("start hidden"). It's on my (extremely long) To Do list.

-- hugh
 
Hello hugh,

Does it change anything when I put the element in a group and I show/hide on group level?
Maybe when I hide the group by default?
The link field can't be hidden (as far as I know).

Greetings,

Filip
 
Does it change anything when I put the element in a group and I show/hide on group level?
Maybe when I hide the group by default?

I dunno, try it and see. :)

The link field can't be hidden (as far as I know).

Yes, I know. That's part of the work I'm intending to do, making the 'hidden' option(s) common to all elements.

Note that you can set "hidden" on any element, by changing the element type to something that does have that option (like 'field'), set Hidden to Yes, then change the element type back and save.

-- hugh
 
I did change the element type to field, set it to hidden, saved, changed the element type back to link and saved again.
Now the element is hidden by default and, via the javascript on the status element, shown only for some status values.

It shows after a short delay but, for me, thats better (less annoying) than showing first and then hide after a short delay.

Thanks,
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top