Spry Validation on Text field
hi, trying figure out how validate text field there no spaces allowed alph characters.
here spry validaton field.
var sprytextfield6 = new spry.widget.validationtextfield("spryregisterlastname");
i've been reeding usecharacter mask, how go using that. so?
var sprytextfield6 = new spry.widget.validationtextfield("spryregisterlastname", "none", {charactermasking: /da-z/ ,usecharactermasking:true, validateon:["blur", "change"]});
when use above code not work.
any appreciated
winrol
first create little javascript function contains regular expression ( see here http://regexlib.com/?aspxautodetectcookiesupport=1) validate there no spaces
<script>
function validatenospaces(value) {
return /^[a-za-z]+$/.test(value)
}
</script>
then apply custom validation constructor
var sprytextfield6 = new spry.widget.validationtextfield("spryregisterlastname", "custom", {validation:validatenospaces, validateon:["blur", "change"]});
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment