character limit on single line field

sarahkapasi
Giga Expert

We have a Service Catalog Item with a single line field variable which has character limit to 40 characters.

find_real_file.png

I would like to make it so the user can't 'Order Now' until 40 characters are in that field.

Thank you,

Sarah

1 ACCEPTED SOLUTION

Ty this:



function onSubmit() {


  var text = g_form.getValue("u_epic_device_haiku_canto");


  var length=text.length;


if(length <40)


{


  alert("Please enter full field");


  return false;


}}


View solution in original post

9 REPLIES 9

Deepak Kumar5
Kilo Sage

var textBox = g_form.getValue("field_name");




var textLength = textBox.value.length;


if(textLength <40)


{


  alert("Please enter full field");


}


Thanks Deep!   where should I put the above script?


You can write it in onChange or OnSubmit Client script.


I tried the following, but I didn't get a pop-up message



find_real_file.png