Home
TeamSite
Javascript validation in Workflow
infoForDj
Hi,
I have a requirement where in if the user selects "Yes" (radio button), then a select box should be visible.
Additionally, the form should not get submitted unless the user selects a value for that drop down.
Current implementation is to bring the focus to dropdown and have a js function on "onLoseFocus" event. This function checks for the value of dropdown. If there is no value, then it alerts the user and brings the focus back to the dropdown.
The users are not very comfortable with this approach as they cannot select "No" (radio button) without specifying the value for the drop down (provided they had selected "Yes" earlier).
Function:
function checkDesigner(win)
{
if(win.document.forms[0].isDesignerRequired[0].checked)
{
// check that designer is selected
// if none selected, do not allow submit
if(win.document.forms[0].designer.value == '')
{
alert("Please select the designer.");
win.document.forms[0].designer.focus();
}
}
}
Please help me to find out documentation which speaks about controlling the "Start Job" button on job definition screen as we will want that js function to get called when the user hits "Start Job" button.
Thanks,
Dhruv
Find more posts tagged with
Comments
jbonifaci
Well, you can't tie into the start job button without hacking something, so I wouldn't recommend it as it is likely to break with an upgrade or path.
Why not just use the valid_input tag to validate the field?
~Jeff