- 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:45 AM
The field name should be number instead?
var a = g_form.getValue('number');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 06:47 AM
Wow i didnt even notice that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 06:49 AM
Hi Anurag Tripathi,
Thanks.
The field name is 'task_number' only. i am sure about it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2017 06:57 AM
g_form can fetch the values of the field only if they exist on the form layout.
So if the fields don't exist on the form layout, then display rule part suggested by Harsh is the way to go.