- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 12:37 AM
Hi All
My script is
HTML
<?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_form>
Number <g:ui_reference name="ritm" id="ritm" table="sc_req_item" completer="AJAXTableCompleter" />
User: <g:ui_reference name="user" id="user" table="sys_user" completer="AJAXTableCompleter"/>
</g:ui_form>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td align="left" nowrap="true"><br />
<g:dialog_buttons_ok_cancel ok="return validateForm()" cancel ="return OnCancel"/>
</td></tr>
</table>
</j:jelly>
Client script
function onCancel() {
var c = gel('cancelled');
c.value = "true";
GlideDialogWindow.get().destroy();
return false;
}
function validateForm() {
var x= gel("ritm").value;
var y= gel("user").value;
if (x== "" ||y=="") {
alert("Please provide data to submit the dialog.");
return false;
}
return true;
}
Ok and Cancel button dont work as expected.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 01:54 AM
Adding this in HTML made it work
<input type="hidden" id="cancelled" name="cancelled" value="false"/>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 10:24 AM
<g:dialog_buttons_ok_cancel ok="return validateForm()" cancel ="return OnCancel"/>
In the above line OnCancel it should be a function so mention like OnCancel()