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
BedrockMission!

Learn More

View all

Sign in to view all badges

Making a field mandatory only when visible?

Avatar

Avatar
Validate 1
Level 1
ellis355
Level 1

Likes

2 likes

Total Posts

62 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 1
Level 1
ellis355
Level 1

Likes

2 likes

Total Posts

62 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile
ellis355
Level 1

16-06-2016

Hi

I want to make fileds only mandatory when they are visible

I thought this code would work but it doesnt seem to do anything?

Here is my code currently - any ideas guys?

if (form1.Page1.DropDownList1.presence == "visible") {

form1.Page1.DropDownList1.mandatory = "error";

}

if (form1.Page1.DropDownList1.presence == "hidden") {

form1.Page1.DropDownList1.mandatory = "disabled";

}

Thanks in annnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnticipation!

Ellis

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 1
ellis355
Level 1

Likes

2 likes

Total Posts

62 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 1
Level 1
ellis355
Level 1

Likes

2 likes

Total Posts

62 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile
ellis355
Level 1

20-06-2016

Thanks guys for your responses - I solved this by forcing the mandatory state each time the visibilty is changed. Not the most elegant but effective.

@Magus - your script looks the business however a little to complex for me to slot into my form - I wil use it in future forms though - thx

Thanks

E

Avatar

Avatar
Validate 1
Level 2
Karwan_Mawlood
Level 2

Likes

7 likes

Total Posts

43 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
Karwan_Mawlood
Level 2

Likes

7 likes

Total Posts

43 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
Karwan_Mawlood
Level 2

19-06-2016

You code looks fine, please share your form to see what's the issue and we can help you .

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

16-06-2016

Hi there,

instead of using adobe's validation which you need to keep track of which field should be set mandatory,

you can use my script to validate any form and it is very similar to adobe's validation, except you decide which fields you don't want to validate instead of which fields to validate.

Also if any field is hidden from the user's view it is not validated by the script. It is a very convenient script if you make any changes to a form.

Hope this will help!

Validation / Reset Functions, easy to manipulate and to change Forms!!!!