Posts

Showing posts with the label HTML

Text in textarea chopped off after quote or apostrophe

I had an issue, where the text in a textarea input was being cut off after a quote or apostrophe.  The form was submitting to a ‘confirm’ mode, which displayed the details entered into the form back to the user for confirmation.  The details were being passed between each page/mode using hidden fields.  I found that if there was a quote or apostrophe in the text entered into the textarea field, it would be chopped of once the data had been submitted, or if pressing the ‘modify’ button on the confirm page.  After having a look at the page source of the confirm page, I noticed that the value from the textarea field which was being stored in a hidden variable spanned across multiple lines in the code.  As the value of the hidden text field was wrapped in quotation marks, the result was that the parser would stop think that the textarea content had finished.  As the content spanned across multiple lines, the parser would resume rendering the page content even t...