Choice Field

rss

Posted by schuess - Jul 3 ’14 at 09:29

1. How do you set a choice field to be required?

2. How do you validate that a choice field has been "checked" or "Not(!) checked"?

 

Thanks

schuess

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 23 days
    #1 by Dmitry Kozlov Jul 7 ’14 at 03:51

    Hi,

    Do you mean to make a field to be required dynamically? If so, just add custom validation into onsubmit handler. Here is a sample:

     
    fd.onsubmit(function() {
    	if (fd.field('Choice').value().length == 0) {
    		alert('Please, fill in the Choice field.');
    		return false;
    	}
    	return true;
    });
    
Displaying 1 to 1 of 1 messages