How can I set custom behavior for status field?
Hi, I have tried your product, it is useful when I need to place fields in custom order on different tabs. I used it to customize our intranet stationery requests system. But I need little bit more complex behavior. I have Choice field, named State. User can choose "New", "Applovement", "Execution", "Done" states. I need to use some cusom validation, for example, when user creates new request it can't set state field value to the Execution or any other state, exept "New". How can I implement it?
- Anthony (Support)
- Moderator
- Posts: 11
- Joined: Sat Nov 17, 2012
JustinTim,
You can use JavaScript button in the ribbon of Form Designer. It is possible to use jQuery, just put in the input window code like this:
//Get current State value
$(document).ready(function () {
prevState = fd.field('State').control().value();
});
//Subscribe for State field changes
fd.field('State').control().change(function () {
var v = fd.field('State').control().value();
//If user tried to set Execution state after New, do something
if (prevState == 'New' && v == 'Execution') {
alert('You cant set Execution state without passing Approvement state')
}
});
You can use JavaScript button in the ribbon of Form Designer. It is possible to use jQuery, just put in the input window code like this:
//Get current State value
$(document).ready(function () {
prevState = fd.field('State').control().value();
});
//Subscribe for State field changes
fd.field('State').control().change(function () {
var v = fd.field('State').control().value();
//If user tried to set Execution state after New, do something
if (prevState == 'New' && v == 'Execution') {
alert('You cant set Execution state without passing Approvement state')
}
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests