- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 06:41 AM
Hi all,
I have a client script where i need to get the value of a hidden field in a form is it possible?
script:
-------
var a = g_form.getValue('task_number');
alert(a);
I am not getting any value when i give alert.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 06:47 AM
Bring the field on the form display and hide it using g_form.setDisplay
Then you will be able to read it as its present on the form. if its not in the layout itself then you will have to read it from server side and will have to make an ajax call for it, long way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 06:47 AM
Bring the field on the form display and hide it using g_form.setDisplay
Then you will be able to read it as its present on the form. if its not in the layout itself then you will have to read it from server side and will have to make an ajax call for it, long way.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 06:54 AM
you need to use display business rule and and get the field value thrugh g_scratchpad and call it in client script.
check the script below i have tested it and it's working.
Display BR:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
g_scratchpad.categoryfield = current.category.getDisplayValue();
})(current, previous);
Client script:
function onLoad() {
//Type appropriate comment here, and begin script below
alert('testing ' + g_scratchpad.categoryfield);
}
Thanks,
Harshvardhan