Make a field required
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hello,
You can implement custom validation in onsubmit handler. Example:
In my sample, since YesNo checkbox is selected, Title field become required.
You can implement custom validation in onsubmit handler. Example:
Code: Select all
fd.onsubmit(function() {
if (fd.field('YesNo').value() && !fd.field('Title').value()) {
alert('Please, fill in Title field.');
return false;
}
return true;
});
-
- Posts: 1
- Joined: Wed Feb 04, 2015
Would this go in the OnClick property of the save button?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
No, you should put this code into JS-editor. Click JavaScript button on the ribbon of Forms Designer to open it.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests