Make Field required

rss

Posted by TWendt - Oct 25 ’16 at 01:45

Hi,

i have a choice Field (Radio buttons) Approved / Not approved. If this field is selected, the people picker field should be a required field. I use this in the JS editor.

fd.onsubmit(function() {
if (fd.field('PME_x002d_Freigabe').value() && !fd.field('PME_x002d_Name').value()) {
alert('Bitte wählen Sie ihren Namen aus / Please, select your name.');
return false;
}

return true;
});

But it does not work. Where is the error?

Best regards

Tom

  • YuriyMedvedev
    Moderator
    Member for: 2 years 9 months 21 days
    #1 by YuriyMedvedev Oct 25 ’16 at 10:00

    Please, use this code

     
    fd.onsubmit(function() {
    
    if (fd.field('PME_x002d_Freigabe').value() && !(fd.field('PME_x002d_Name').value().length)) {
    
     alert('Bitte wählen Sie ihren Namen aus / Please, select your name.');
    
     return false;
    
    }
    
    return true;
    
    });
Displaying 1 to 1 of 1 messages