Hi, i need to change the form validation on one of my fields. At the moment it checks to see: if ((numofchar<1) || (numofchar>500) || value=='(Please fill in this field)') HTML: - that the field has less than 1 character - that the field has more than 500 characters - if the field has the text (Please fill in this field) I need to change it to check to see if the filed contains (Please fill in this field) along with other characters... So at the moment the validation will pick up if the filed has 1. (Please fill in this field) BUT what is it has 2. (Please fill in this field)asdsfdf Can someone please adjust my code above to make sure that it checks to see if the field contains the string (Please fill in this field) instead of just looking for (Please fill in this field) exactly, thanks for your help
You can use the "indexOf" function and checking the -1 return value. Example: http://www.w3schools.com/jsref/jsref_indexOf.asp
So difficult to do your request, because we must do a lot of thing to check string, we can use many different algorithms to do it for good, so it's unnecssesary to spend time for this thing; I think that