how to set value using g_form.setvalue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2018 10:27 AM
function onSubmit() {
//Type appropriate comment here, and begin script below
var a=g_form.getValue("state");
var b=g_form.getValue("hold_reason");
if(a==3 && b!='')
{
g_form.setValue("state", 4);
g_form.setValue('hold_reason',b);
here the value of ' b' is becoming null .any suggestions
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2018 10:29 AM
looks like you're missing an '{' in the end. Should be:
var a = g_form.getValue("state");
var b = g_form.getValue("hold_reason");
if(a==3 && b != '') {
g_form.setValue("state", 4);
g_form.setValue('hold_reason', b);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 10:39 PM
what will be for multiplication and adition

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 11:19 PM
Place below alert code before if statement line and observe if hold_reason is really having a value.
alert("Value of b is " + b);
And I believe hold_reason field is displayed on the form because g_form.getValue() WORKS only if field is on the form.