Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
02-07-2007, 10:29 PM #1
- Join Date
- Feb 2007
- Thanked 0 Times in 0 Posts
how to retain quotes in the value after submitting the page
I have a text box if a user enters a phrase he enters it within single(') or double quotes(").
If the properties for test box are like this
<input name="test" id="test" value = "<%=queryText"%>"> then
the text box value is blank after submitting the form and when sourcecode is checked the value is ""testing"".
if modified to <input name="test" id="test" value = <%=queryText"%>>
then the value is shown after submitting the form as testing without quotes
The page is JSP search page.After submitting the page appears with all the results since it is a search page
How can I retain the value as it is when the value is entered in quotes.
02-08-2007, 07:38 AM #2
- Join Date
- Jun 2002
- London, England
- Thanked 2,542 Times in 2,520 Posts
Would it not be simpler if the user entered the search term without any quotes, and then these were added before submission.
testStuff = '"' + testStuff + '"';