Make a field required based on input in another field


so have researched forum answer question of how make fields in form required if value entered in designated field, , not required if no value entered in designated field.

 

for example:

 

there field titled qty_paper, , if value entered qty_paper, field progrow1 should become required.

 

if no value entered qty_paper, progrow1 not required.

 

i've tried both formcalc , javascript, no results. in formcalc added script mouseexit event on qty_paper:

 

if ($.isnull == 0) then

     //make budget field required
     progrow1.validate.nulltest = "error";
endif

 

and added script in formcalc mouseexit event on progrow1:

 

if ($.isnull == 0) then

$.validate.nulltest = "disabled"

endif

 

this came verbatim post on forum, i'm thinking i'm missing obvious here... isn't odd i'm still pretty new @ adding scripts. please if can!

you'd want combine both scripts on first field if/else statement. , i'd use exit event instead of mouse exit (not sure if mouse exit handles tabbing in , out of fields).

 

the first script should have worked, second script asking if progrow1 null, not qty_paper.

 

formcalc:

if ($.isnull) then

     progrow1.validate.nulltest = "error"

else

     progrow1.validate.nulltest = "disabled"

endif



More discussions in LiveCycle Designer


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support