Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    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.

    Thanks

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Would it not be simpler if the user entered the search term without any quotes, and then these were added before submission.

    e.g.

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •