Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quotations

Status
Not open for further replies.

cjkenworthy

Programmer
Sep 13, 2002
237
GB
I want to check if a user has put in a " anywhere in a set of text fields. How can I check for the " :

var invalid = """;

//I want invalid to be set to "

if (document.callback.txtnotes.value.indexOf(invalid) > -1) {
alert("Invalid character!");
return false;
}

This won't work! as it thinks that the " is part of the declaration.
 
Try to replace :
Code:
var invalid = """;
by :
Code:
var invalid = "\"";
as the backslash causes the folowwing char not to be interpreted by java.
Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top