R
rn5a
When a Button is clicked in a Form, the JavaScript 'prompt' dialog
pops-up for users to enter any text. When the user clicks OK in the
prompt dialog, the text is populated in a TextBox & the Form posts. I
then retrieve the text using Request.Form.
The problem I am facing is in retaining whitespaces in the text the
user has entered. Assume that the user has entered the following text
in the JavaScript prompt dialog (note the whitespaces in the string):
"abc def ghi jkl"
The double quotes have been added just to show where the string ends;
they aren't a part of the string.
Now when I retrieve the string using Request.Form, this is what I get
(once again please neglect the double quotes):
"abc def ghi jkl"
i.e. irrespective of the number of whitespaces a user has inserted in
between the words in the JavaScript prompt dialog, Request.Form always
replaces all the whitespaces in between the various words in the string
with a single whitespace.
How do I ensure that the whitespaces inserted by the user in the
JavaScript prompt dialog are retained by Request.Form?
pops-up for users to enter any text. When the user clicks OK in the
prompt dialog, the text is populated in a TextBox & the Form posts. I
then retrieve the text using Request.Form.
The problem I am facing is in retaining whitespaces in the text the
user has entered. Assume that the user has entered the following text
in the JavaScript prompt dialog (note the whitespaces in the string):
"abc def ghi jkl"
The double quotes have been added just to show where the string ends;
they aren't a part of the string.
Now when I retrieve the string using Request.Form, this is what I get
(once again please neglect the double quotes):
"abc def ghi jkl"
i.e. irrespective of the number of whitespaces a user has inserted in
between the words in the JavaScript prompt dialog, Request.Form always
replaces all the whitespaces in between the various words in the string
with a single whitespace.
How do I ensure that the whitespaces inserted by the user in the
JavaScript prompt dialog are retained by Request.Form?