Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Using Javascript to hide objects that have no "binding" tab?

Avatar

Level 2

Hello,

I'm attempting to create a form that uses checkboxes to hide a variety of fields. I've run into a problem though; it seems that only text fields have a binding tab (unless I'm missing something).  Is there a way for me to do show hides for images and text boxes? When I hold ctrl and hover over these items there is a small circle with a red line through it, which seems to express that it is impossible to manipulate them using javascript.

For the record, I'm using javascript as seen below:

BusinessDBAname.presence = "hidden";

If someone had any definite answers on this I'd really appreciate it.

4 Replies

Avatar

Level 10

Hi,

as long you created a new form in Designer and did not import a existing PDF you can propably show or hide almost every object in your form.

The red sign you see indicates that Designer cannot created a SOM expression to the object the cursor hovers over.

But this can have a couple of reasons.

For example the object may be located on a master page but you're currently referencing from a body page.

It would be helpful to see your form for a more specific answer.

Just upload it somewhere and post a link here, so we can look over it.

Avatar

Level 2

Thanks for your help. I uploaded the file:

http://s000.tinyupload.com/index.php?file_id=99824864268687444891

Please tell me what you think. I didn't create the form, I've just been maintaining it after the person who made it left.

Avatar

Level 10

Hi,

sorry to say that, but this is a really bad form design.

There are a couple of things you can make it better.

1. Give unnamed subforms a suitable naming

2. Use subforms to organise your form

3. Don't embed fonts at all when you only use the default fonts Arial or Myriad Pro

4. Don't select the checkbox to embed images (they will get embedded always but this method requires more space)

5. Set option to prevent script changes in the form to automatically, otherwise the changes wont be saved

Ok, I suggest you to create a set of subforms to represent your Section 1 - 9.

In each subform you then add a subform for business and sole proprietor.

Into those subforms you then put the desired fields, images etc.

This allows you much shorter scriptings because you only have to change the presence of the surrounding subforms to show/hide an entire set of objects.

You form design finally should look something like this.

form1

     Maserpage

     PayeeSetupRequest

          Section1

               Business

                    Textfield1

                    ...

                    Textfield5

               SoleProprietor

                    Textfield1

                    ...

                    Textfield3

          Section2

               Business

                    Textfield1

                    ...

                    Textfield5

               SoleProprietor

                    Textfield1

                    ...

                    Textfield3

          Section3

               ...

     

Hope this helps.

Avatar

Level 2

Right, I understand that the form might not be optimized in the best way. As I mentioned I'm the one maintaining it, not the creator. Thanks for your input, I'll keep it in mind as I move forward.

Do your suggestions apply to my question though? Even if I put things into the sub fields I'd need some way to reference them. Would that be through manipulation of the javascript at the subform level?