Archive for August, 2007:
Simple Javascript Form Field Validation
1 Comment | This entry was posted on Aug 09 2007
Quick Regex form validation to check if a field contains numbers only...
JavaScript:
-
function isNumeric(elem, msg){
-
var alphaExp = /^<strong>[0-9]</strong>+$/;
-
if(elem.value.match(alphaExp)){
-
return true;
-
}else{
-
alert(msg);
-
elem.focus();
-
return false;
-
}
-
}
Simple Javascript Delete Confirmation
1 Comment | This entry was posted on Aug 09 2007
Put this in between the tags...
JavaScript:
-
function confirmDelete(delUrl) {
-
if (confirm("Are you sure you want to delete this item?")) {
-
document.location = delUrl;
-
}
-
}
