All pastes #441190 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-04-15 15:39 UTC
rendered paste body
// form valadation for ECA
mail=/[a-z]{6}@.*?(\.com|\.co\.uk)/
function submitIt(myForm) {
if (mail.test(myForm.billEmailAddress.value)) {
	return true
}
alert("Invalid email address") <!--warning window-->
myForm.billEmailAddress.focus()
myForm.billEmailAddress.select() <!--return user back to email field on clicking ok on alert-->
return false
}

street=/\D/ <!--initial char must be a letter not a number followed by any combination of letters and spaces-->
function submitIt(myForm) {
if (street.test(myForm.shipStreetName.value)) {
	return true
}
alert("Invalid street name ") <!--warning window-->
myForm.shipStreetName.focus()
myForm.shipStreetName.select() <!--return user back to wrong field on clicking ok on alert-->
return false
}