View Full Version : how to retain quotes in the value after submitting the page

02-07-2007, 11:29 PM
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.


Philip M
02-08-2007, 08:38 AM
Would it not be simpler if the user entered the search term without any quotes, and then these were added before submission.


testStuff = '"' + testStuff + '"';