- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2016 11:03 PM
Below is extract of UI Page
<g:ui_input_field type ="date" name="Alarm End Date" id="AlarmEndDate" label="Alarm End Date" value="${jvar_alarm_end_time}" mandatory="true" />
<td style="padding-bottom:7px">
<g:ui_input_field type ="time" name="Alarm End Time" id="AlarmEndTime" label="Alarm End Time" value="${jvar_alarm_end_time}" mandatory="true" />
I am trying to read the values using :
var alarm_date = gel("AlarmEndDate").value;
var alarm_time = gel("AlarmEndTime").value;
Any suggestions on how to read the value?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2016 01:17 AM
How about the below?
1) Code
2) Screenshot of result (onLoad fetches current date time)
3) Works on onChange as well
Alert Message
Code snippet:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_date_time name="end_date" id="end_date" value='${gs.nowDateTime()}' label="Alarm End Date & Time" onChange="alertDateTime()" onload="alertDateTime()"/>
<script>
function alertDateTime()
{
alert("Alarm DateTime - "+document.getElementById("end_date").value);
}
</script>
</j:jelly>
Please let me know if you face any issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2016 11:37 PM
Hi Ramakrishana,
You can try this , Hits: Always use small letters for passing an id i.e.:id=alarm_end_date and id=alarm_end_time.
var alarm_date = gel('alarm_end_date').value;
if (gel('alarm_end_date').value == ' ') {
alert("${JS:gs.getMessage('Please input your End Date')}");
var alarm_time =gel('alarm_end_time').vale;
if (gel('alarm_end_time').value == ' ') {
alert("${JS:gs.getMessage('Please input your End Time')}");
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2016 12:16 PM
i did try changing the id to small letters, but still have the same issue

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2016 05:18 AM
Hi Srinivasa,
Your script should work. Just put your code in-between <script> tags.
<g:ui_input_field type ="date" name="Alarm End Date" id="AlarmEndDate" label="Alarm End Date" value="${jvar_alarm_end_time}" mandatory="true" />
<td style="padding-bottom:7px">
<g:ui_input_field type ="time" name="Alarm End Time" id="AlarmEndTime" label="Alarm End Time" value="${jvar_alarm_end_time}" mandatory="true" />
<script>
var alarm_date = gel("AlarmEndDate").value;
var alarm_time = gel("AlarmEndTime").value;
alert("Alarm Date - "+alarm_date);
alert("Alarm Time - "+alarm_time);
</script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2016 12:26 PM
i was not to get this working ... my field is in HTML and I need to access that from client script of the same page.