- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2017 10:41 PM
Hi All,
I have configured a ui page with 2 check box. Below is the code.
<g:ui_checkbox name="resolution time" id="check1" onclick="addvalue();"/>Check1
<g:ui_checkbox name="difficulties" id="check2" onclick="addvalue2();"/>Check2
Now i need to have these checkbox values in client script. Below is the code.
function addvalue()
{
var ch1 = document.getElementById("check1").checked;
alert("Check1 is: "+ch1);
}
In the alert i am getting "UNDEFINED".
How to get the value. Please help me on this.
Thanks,
Maddy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 04:23 AM
Hi All,
Below peice of code worked for me.
<g:ui_checkbox name="resolution time"/>Check1
<g:ui_checkbox name="difficulties"/>Check2
Now i need to have these checkbox values in client script. Below is the code.
function addvalue()
{
var ch1 = document.getElementById("resolution_time").value;
alert("Check1 is: "+ch1);
}
Thanks for all your support.
Thanks,
Maddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2020 05:00 AM
If you use a regular input checkbox:
<input type="checkbox" id="resolution_time" name="resolution_time" value="${sysparm_resolution_time}"/>
where the default value is set in sysparm_resolution_time, then you can get the value like this in the client script:
gel('resolution_time').checked;