Sep 22nd, 2013, 11:29 PM
Hi guys,
Hope you can enlighten me. I have a Pulldown field with 6 values, "0" to "5", with an adjacent Text field for comments. I need to require the comment field be filled out only when the value of the Pulldown is 0, 1, or 2. This is what I've come up with so far:
This is the first instance of 20 such instances on the form, which has worked with all fields simply "required." With this code on the form, the error reporting gets truncated to an error that is always and only about the element_10B field regardless of how the form is filled out.
I started with this example code as a template:
but something seems to be missing. I thought I would be validating based on the "range=X-Y" requirement, but I don't see where it belongs in the code. Could you point me in the right direction?
Much appreciated,
Mark Harrison
Hope you can enlighten me. I have a Pulldown field with 6 values, "0" to "5", with an adjacent Text field for comments. I need to require the comment field be filled out only when the value of the Pulldown is 0, 1, or 2. This is what I've come up with so far:
Code:
rules.push("required,element_9,Please select an Sportsmanship Rating.");
rules.push("if:element_9=0,required,element_9B,Please enter an Sportsmanship Comment.");
rules.push("if:element_9=1,required,element_9B,Please enter an Sportsmanship Comment.");
rules.push("if:element_9=2,required,element_9B,Please enter an Sportsmanship Comment.");
This is the first instance of 20 such instances on the form, which has worked with all fields simply "required." With this code on the form, the error reporting gets truncated to an error that is always and only about the element_10B field regardless of how the form is filled out.
I started with this example code as a template:
Code:
[if:FIELDNAME=VALUE,]REQUIREMENT,fieldname[,fieldname2[,fieldname3,date_flag]],error message"
but something seems to be missing. I thought I would be validating based on the "range=X-Y" requirement, but I don't see where it belongs in the code. Could you point me in the right direction?
Much appreciated,
Mark Harrison