Looping to set Required

rss

Posted by schuess - Feb 25 ’14 at 09:51

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

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 2 months 8 days
    #1 by Dmitry Kozlov Feb 26 ’14 at 08:26

    Hi Matt,

    Please, try the following JS-code:

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