<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: gel is not working in ui page in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820958#M477884</link>
    <description>&lt;P&gt;your script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;

&amp;lt;g:ui_form&amp;gt;

&amp;lt;div class="row"&amp;gt;
&amp;lt;div &amp;gt;
&amp;lt;span style="padding:16px;font-weight:bold;"&amp;gt;What were you attempting to do when the performance issue occurred?&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class="row"&amp;gt;
&amp;lt;div class="form-horizontal"&amp;gt;
&amp;lt;div class="form-group" style="margin-left:16px !important;margin-right:16px !important"&amp;gt;
&amp;lt;textarea id="comments" name="comments"&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class="modal-footer"&amp;gt;
&amp;lt;span class="pull-right"&amp;gt;

&amp;lt;button class="btn btn-primary" id="ok_button" onclick="actionOK()" style="min-width: 5em;" title="" type="submit"&amp;gt;
Send Email
&amp;lt;/button&amp;gt;
&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;input type="hidden" id="kbSysID" name="kbSysID" value="${sysparm_sysID}"/&amp;gt;
&amp;lt;/g:ui_form&amp;gt;

&amp;lt;/j:jelly&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;function actionOK() {

// 	alert("entered");
	var value = gel('comments').value;
// 	alert(value);
	if (value != '') {
		alert("comments filled");
		return true;

	} else {
		alert("please fill");
		return false;
	}
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Aug 2020 12:36:10 GMT</pubDate>
    <dc:creator>hvrdhn88</dc:creator>
    <dc:date>2020-08-13T12:36:10Z</dc:date>
    <item>
      <title>gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820949#M477875</link>
      <description>&lt;P&gt;I have created a UI page with textarea amd in client script I have written that when text area is empty it should show an alert box.But even text area is empty it is returning true.Help me on this?&lt;/P&gt;
&lt;P&gt;HTML:&lt;/P&gt;
&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;BR /&gt;&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;&lt;BR /&gt; &lt;BR /&gt;&amp;lt;g:ui_form&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;div class="row"&amp;gt;&lt;BR /&gt; &amp;lt;div &amp;gt;&lt;BR /&gt; &amp;lt;span style="padding:16px;font-weight:bold;"&amp;gt;What were you attempting to do when the performance issue occurred?&amp;lt;/span&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="row"&amp;gt;&lt;BR /&gt; &amp;lt;div class="form-horizontal"&amp;gt;&lt;BR /&gt; &amp;lt;div class="form-group" style="margin-left:16px !important;margin-right:16px !important"&amp;gt;&lt;BR /&gt; &amp;lt;textarea id="comments" name="comments"&amp;gt;&amp;lt;/textarea&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="modal-footer"&amp;gt;&lt;BR /&gt; &amp;lt;span class="pull-right"&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;button class="btn btn-primary" id="ok_button" onclick="actionOK()" style="min-width: 5em;" title="" type="submit"&amp;gt;&lt;BR /&gt; Send Email&lt;BR /&gt; &amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;/span&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;input type="hidden" id="kbSysID" name="kbSysID" value="${sysparm_sysID}"/&amp;gt;&lt;BR /&gt;&amp;lt;/g:ui_form&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/j:jelly&amp;gt;&lt;/P&gt;
&lt;P&gt;clientscript:&lt;/P&gt;
&lt;P&gt;function actionOK() {&lt;/P&gt;
&lt;P&gt;alert("entered");&lt;BR /&gt; var value = gel('comments').value;&lt;BR /&gt; alert(value);&lt;BR /&gt; if (value != '') {&lt;BR /&gt; alert("comments filled");&lt;BR /&gt; return true;&lt;/P&gt;
&lt;P&gt;} else {&lt;BR /&gt; alert("please fill");&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 11:34:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820949#M477875</guid>
      <dc:creator>Susmitha14</dc:creator>
      <dc:date>2020-08-13T11:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820950#M477876</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Try writing&amp;nbsp;&lt;STRONG&gt;return&amp;nbsp;&lt;/STRONG&gt;before client script call &lt;STRONG&gt;onclick="actionOK()"&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 11:53:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820950#M477876</guid>
      <dc:creator>Onkar Pandav</dc:creator>
      <dc:date>2020-08-13T11:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820951#M477877</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I should write as return="actionOK()" or not?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:02:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820951#M477877</guid>
      <dc:creator>Susmitha14</dc:creator>
      <dc:date>2020-08-13T12:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820952#M477878</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;please update html as below and check in alert if comments come or not&lt;/P&gt;
&lt;P&gt;HTML:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ng-scope"&gt; &amp;lt;textarea id="comments" name="comments" &lt;STRONG&gt;value=""&lt;/STRONG&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ng-scope"&gt;Client Script:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;function actionOK() {&lt;/P&gt;
&lt;P&gt;alert("entered");&lt;BR /&gt; var value = gel('comments').value;&lt;BR /&gt; &lt;STRONG&gt;alert(value);&lt;/STRONG&gt;&lt;BR /&gt; if (value != '') {&lt;BR /&gt; alert("comments filled");&lt;BR /&gt; return true;&lt;/P&gt;
&lt;P&gt;} else {&lt;BR /&gt; alert("please fill");&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="ng-scope"&gt;Regards&lt;BR /&gt;Ankur&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:12:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820952#M477878</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2020-08-13T12:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820953#M477879</link>
      <description>&lt;P&gt;i tested your script. its working. i can see alert is coming.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:14:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820953#M477879</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2020-08-13T12:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820954#M477880</link>
      <description>&lt;P&gt;I have tried using that html ,but still it is returning true even the textarea is empty. andin the button how should I call actionOK().&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:26:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820954#M477880</guid>
      <dc:creator>Susmitha14</dc:creator>
      <dc:date>2020-08-13T12:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820955#M477881</link>
      <description>&lt;P&gt;Alerts are working fine but even the textarea is empty, it is showing an alert saying "comments are filled"&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:32:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820955#M477881</guid>
      <dc:creator>Susmitha14</dc:creator>
      <dc:date>2020-08-13T12:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820956#M477882</link>
      <description>&lt;P&gt;no it is not. if its empty i am getting only else part of alert ( alert("please fill") );&lt;BR /&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:33:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820956#M477882</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2020-08-13T12:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820957#M477883</link>
      <description>&lt;P&gt;screenshot for reference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My test step , just clicked on try it on ui page.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/47913i70B22675DE6FFF27/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/47913i70B22675DE6FFF27/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:34:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820957#M477883</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2020-08-13T12:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820958#M477884</link>
      <description>&lt;P&gt;your script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;

&amp;lt;g:ui_form&amp;gt;

&amp;lt;div class="row"&amp;gt;
&amp;lt;div &amp;gt;
&amp;lt;span style="padding:16px;font-weight:bold;"&amp;gt;What were you attempting to do when the performance issue occurred?&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class="row"&amp;gt;
&amp;lt;div class="form-horizontal"&amp;gt;
&amp;lt;div class="form-group" style="margin-left:16px !important;margin-right:16px !important"&amp;gt;
&amp;lt;textarea id="comments" name="comments"&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class="modal-footer"&amp;gt;
&amp;lt;span class="pull-right"&amp;gt;

&amp;lt;button class="btn btn-primary" id="ok_button" onclick="actionOK()" style="min-width: 5em;" title="" type="submit"&amp;gt;
Send Email
&amp;lt;/button&amp;gt;
&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;input type="hidden" id="kbSysID" name="kbSysID" value="${sysparm_sysID}"/&amp;gt;
&amp;lt;/g:ui_form&amp;gt;

&amp;lt;/j:jelly&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;function actionOK() {

// 	alert("entered");
	var value = gel('comments').value;
// 	alert(value);
	if (value != '') {
		alert("comments filled");
		return true;

	} else {
		alert("please fill");
		return false;
	}
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Aug 2020 12:36:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820958#M477884</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2020-08-13T12:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: gel is not working in ui page</title>
      <link>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820959#M477885</link>
      <description>&lt;P&gt;if still you having an issue , can you try with below script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTML&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;

	
	&amp;lt;g:ui_form&amp;gt;
	&amp;lt;!-- Get values from dialog preferences passed in --&amp;gt;
	&amp;lt;!-- Set up form fields and labels --&amp;gt;
	&amp;lt;table width="100%"&amp;gt;
		&amp;lt;tr id="description_row" valign="top"&amp;gt;
			&amp;lt;td colspan="2"&amp;gt;
				&amp;lt;!-- Short description value used as a label --&amp;gt;
				&amp;lt;p&amp;gt; Community Test &amp;lt;/p&amp;gt;
			&amp;lt;/td&amp;gt;
		&amp;lt;/tr&amp;gt;
		&amp;lt;tr&amp;gt;
			&amp;lt;td&amp;gt;
				&amp;lt;!-- Comments text field (Contains comments from originating record as a default) --&amp;gt;
				&amp;lt;g:ui_multiline_input_field name="dial_comments" id="dial_comments" label="Additional comments" value="" mandatory="true" /&amp;gt;
			&amp;lt;/td&amp;gt;
		&amp;lt;/tr&amp;gt;
		&amp;lt;tr&amp;gt;
			&amp;lt;td colspan="2"&amp;gt;
			&amp;lt;/td&amp;gt;
		&amp;lt;/tr&amp;gt;
		&amp;lt;tr id="dialog_buttons"&amp;gt;
			&amp;lt;td colspan="2" align="right"&amp;gt;
				&amp;lt;!-- Pull in 'dialog_buttons_ok_cancel' UI Macro for submit/cancel buttons.
	'ok' option will call the 'validateComments' Client script function from the UI Page--&amp;gt;
				&amp;lt;button onclick="validateComments()"&amp;gt;Click me&amp;lt;/button&amp;gt;
			&amp;lt;/td&amp;gt;
		&amp;lt;/tr&amp;gt;
	&amp;lt;/table&amp;gt;
&amp;lt;/g:ui_form&amp;gt;
	
&amp;lt;/j:jelly&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UI Page Client script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;function validateComments() {
	//Gets called if the 'OK' dialog button is clicked
	//Make sure dialog comments are not empty
	var comments = gel("dial_comments").value;
	comments = trim(comments);
	if (comments == "") {
		//If comments are empty stop submission
		alert("Please provide comments to submit the dialog.");
		return false;
	}

	else{
		alert('filled');	
	}
	//If comments are not empty do this...
	GlideDialogWindow.get().destroy(); //Close the dialog window
	g_form.setValue("comments", comments); //Set the 'Comments' field with comments in the dialog
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reference:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/"&gt;https://www.servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 13:10:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/gel-is-not-working-in-ui-page/m-p/1820959#M477885</guid>
      <dc:creator>hvrdhn88</dc:creator>
      <dc:date>2020-08-13T13:10:35Z</dc:date>
    </item>
  </channel>
</rss>

