Page 1 of 1

Looping to set Required

Posted: 25 Feb 2014
by schuess
I am a javascript beginner and need some guidence with a loop that will accomplish the following. I have several fields of the same input type that i want to set the required field on.


For each fd.field

where fd.field of input type = "radio"

set fd.field(' x ').title().required(true);


thanks

schuess

Re: Looping to set Required

Posted: 26 Feb 2014
by Dmitry Kozlov
Hi Matt,

Please, try the following JS-code:

Code: Select all

$.each($('[fd_type="RadioButtons"]').closest('.fd_field'), function () {
  fd.field($(this).attr('fd_name')).titleRequired(true);
});