Created
August 10, 2009 12:40
-
-
Save neilbradley/165167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create our form | |
var myForm = new glow.forms.Form("#fmcustomer") | |
var myForm = glow.lang.trim("txtCompany","txtForename","txtSurname2) | |
// add tests for First Name | |
.addTests( | |
"txtCompany", | |
["required", { | |
on: "change submit", | |
message: "Please tell us your company name" | |
}] | |
) | |
.addTests( | |
"txtForename", | |
["required", { | |
on: "change submit", | |
message: "Please tell us your first name" | |
}], | |
["regex", { | |
on: "idle change submit", | |
arg: /^[A-Za-z]+$/, | |
message: "Your first name can only contain letters" | |
}] | |
) | |
.addTests( | |
"txtSurname", | |
["required", { | |
on: "change submit", | |
message: "Please tell us your last name" | |
}], | |
["regex", { | |
on: "idle change submit", | |
arg: /^[A-Za-z]+$/, | |
message: "Your last name can only contain letters" | |
}] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment