how to access jvar in UI page client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 08:59 AM
Hi,
I have one value set on jvar on UI Page HTMl and I want to show one alert message depending on the value set on submit of the UI page.
For that reason I want to check jvar value on onSubmit function of the UI page client script. I am not aware of the syntax on how to do that
HTML-
<g:evaluate expression="RP.getParameterValue('sysparm_flag')" var="jvar_flag"/>
Client Script-
function onSubmit() {
if (jvar_flag===<something>) // not sure of the syntax
{
alert("something");
return false;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2016 09:02 AM
jvar_ is a server side construct. You would have to set a hidden field with that value for the client script to get access. The client script/browser only knows HTML, CSS, and JavaScript.
Something like this could help.
<input type="text" name='flag' value="${jvar_flag}" />
Then your client script can get it with the traditional means of accessing input field values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 12:01 AM
Hi Chuck,
I might sound silly but how do I access input field values in the client script.
Should I use g_form.setValue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 12:04 AM
I order to access the variable. Provide an id to the tag.
Use gel("idNAME").value to access the value of the tag.
Let me know if this was helpful/correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2017 09:06 PM