Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

UI Page How to make mandatory text area field

Anish9515
Tera Contributor

Hi @ANKUR BAWISKAR

How to make mandatory text area field  in UI page?
Let me know how to client script in ui page 
I wanna use this UI pages on change request table  , Some one changes Planned start& end date to past date they mentioned additional information makes mandatory , Below screenshot when i on click uiaction button on change request table

 

whatever reflects UI page output should reflect on my Change request table

Please help me on this @Ankur Bawiskar 

 

Regards ,

Suresh

12 REPLIES 12

Alert ("test"); , It's working fine on table level but coming to my Additional information field validation it's not working alert on table level

 

Hi Ankur ,

I written debug alert
function onsubmit(){

alert ('test');

}

}

It's working fine

Joel Dion1
Tera Contributor
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
	<j:set var="jvar_message" value="${sysparm_message}" />
	<script>
		function enableOK(){
			var value = gel('glide_prompt_answer').value;
			var button = gel('ok_button');
				if(value!=''){
					button.disabled=false;
			}else{
				button.disabled=true;
			}
		}
	</script>
	<g:ui_form >
		<div class="row">
			<div>
				<span style="padding: 16px; font-weight: bold">${jvar_message}</span>
			</div>
		</div>
		<div class="row">
			<div class="form-horizontal">
				<div class="form-group" style="margin-left: 16px !important; margin-right: 16px !important">
					<textarea id="glide_prompt_answer" oninput="enableOK()" name="glide_prompt_answer" class="form-control" spellcheck="true"
						style="overflow: hidden; word-wrap: break-word; resize: none" required="true"> </textarea>
				</div>
			</div>
		</div>
		<div class="modal-footer">
			<span class="pull-right">
        <button
          class="btn btn-default"
          id="cancel_button"
          onclick="window.GlideModalForm.prototype.locate(this).destroy(); return false"
          style="min-width: 5em"
          title=""
          type="submit"
        >
          Cancel
        </button>
        <button
          class="btn btn-primary"
          id="ok_button"
          onclick="invokePromptCallBack('ok')"
          style="min-width: 5em"
          title=""
          type="submit"
		  disabled="true"
        >
          OK
        </button>
      </span>
    </div>
	</g:ui_form>
</j:jelly>