Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (myField.value.match(/S/)) {
- // field is not empty
- }
- /^s*$/.test(string)
- var empty_string = /^s*$/; //create RegExp object for re-use
- if (empty_string.test(myFormField.value))
- {
- alert("Please be a bit more elaborate!");
- }
- /s/ or /S/
- /^s+$/ or /^S+$/
- if(string.match(/^s+$/)) {
- alert("string is empty!");
- }
- if(!string.match(/^S+$/)) {
- alert("string is empty!");
- }
Add Comment
Please, Sign In to add comment