on 03-10-2015 9:25 AM
You can use the "Link" button (looks like a few links of a chain) to link a text field to a script button, so that pressing enter with the focus in the field will cause the script to be run. That script can then do any validation you need. Is that what you are asking for?
On a practical note, create a script button and build/test the script by pressing the button. Once it is working correctly, then link it to the relevant text field and hide the button (the user doesn't need to actually press it once it is linked, so it does not need to be visible).
Steve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do that with a "Calculate in JavaScript" action in the script. Use "Copy Value" first to grab the value from the "services end" field, and call it, say, "enddate". In the JavaScript, you can then access the value as "args.enddate". Do whatever validation you need in JavaScript and set a variable, say "args.valid", accordingly. The following steps of your script can then interact with screen elements to provide feedback as necessary - issue error messages, or whatever you need.
Does that make sense?
Steve.
hi Roman,
In cases like these, as Steve suggested, posting your script will help others to identify where you are going wrong.
If you want a simple date format validation, you can use Regex. Something like this:
//regex for dd/mm/yyyy
var yourExpression = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
var yourDate = "07/06/1986".
if(yourDate.match(yourExpression)){
alert("correct date");
}
Regards,
Sushant
i have posted the script.@Steve please do let me know where i am going wrong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.