variable length restriction and validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2014 12:54 PM
Hi All,
I have a requirement where one variable should accept only numbers and should be limited to 10 characters.
I have wrote a below onchange script to accept only numbers and onload script for field length.
Unfortunately onload script is not working.. any help please........
OnChange
function onChange(control, oldValue, newValue, isLoading) {
var callBack = g_form.getValue('callback');
if(callBack.match(/\D/)){
alert('Please enter only numbers!');
g_form.setValue('callback,'');
}
}
Onload
function onLoad() {
var call_back = g_form.getControl('callback');
alert(call_back);
call_back.maxLength = 10;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2015 03:45 AM
A single quote is missing before the comma after the word callback.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2014 06:07 PM
Hi,
Make this an onSubmit with a focus and highlight of the field explaining the guidelines for submitting? I dont get the point of onload where it should'nt have been posible posting at the first time?
Kind regards,
Dan Berglin