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 derfloh 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
Joined
Sep 13, 2002
Messages
237
Location
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

  • Locked
  • Question Question
Replies
1
Views
66
Replies
5
Views
236

Part and Inventory Search

Sponsor

Back
Top