- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 10:44 AM
I want to display a message when the user selects I am not sure.
Currently the message displays no matter which choice is made
I am not sure how to select the choice that I want so that the message populates.
This is the script that I am using
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.showFieldMsg('why_form_needed','If you are not sure why the form is needed, please verify with supervisor','info');
}
Finally I want to deny submitting the form until that choice changes to New Form or Update existing form.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 07:50 PM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(g_from.getValue("why_form_needed")=="actual value of select box choice"){
//Type appropriate comment here, and begin script below
g_form.showFieldMsg('why_form_needed','If you are not sure why the form is needed, please verify with supervisor','info');
return false;
}
}
please try the above code and replace the "actual value of select box choice" of "I am not sure" question choice in the variable "why_form_needed".
Let me if this helps.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 11:11 AM
Hi,
Before the showfieldmsg line,you have to check the value of variable selcted by end user.
I.e. g_form.getvalue('why_form_needed').
If it comes out to be "i am not sure" then only showfieldmsg should run.
Try adding it in if condition and return false in the end to stop it from submitting.
Let me know if it works for you or i can provide the entire code.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 11:27 AM
I tried this with no luck .
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.getvalue("I am not sure");
g_form.showFieldMsg('why_form_needed','If you are not sure why the form is needed, please verify with supervisor','info');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2016 07:50 PM
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(g_from.getValue("why_form_needed")=="actual value of select box choice"){
//Type appropriate comment here, and begin script below
g_form.showFieldMsg('why_form_needed','If you are not sure why the form is needed, please verify with supervisor','info');
return false;
}
}
please try the above code and replace the "actual value of select box choice" of "I am not sure" question choice in the variable "why_form_needed".
Let me if this helps.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2016 07:16 AM