• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Textbox String

 
Ranch Hand
Posts: 111
jQuery Oracle C++
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I created a servlet that creates a html form with a textbox and a submit button. The form posts to the same servlet which in turn reverses the string entered in the textbox and creates the same form as before only now with the reversed text in the textbox. If the user presses the submit button again the reversed text should go back to what it was.
My servlet seems to work for all text except when a single quote is placed in the textbox and submitted. What happens is the text after a single quote gets reversed and sent back but cuts off the text that was before the single quote to begin with.
My guess that this happens is because I use s single quotes to set what the value of the textbox will be on the form. This is part of what I do in the code:
out.print( "<INPUT TYPE='TEXT' NAME='text' value='" );
//code to take in the string and reverse then print
out.print( "' size='50'>" );
Any Suggestions?
Amber
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic