472,352 Members | 1,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

Retain Whitespaces

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 entered by the user in the
JavaScript prompt dialog are retained by ASP?

Jan 6 '07 #1
1 1911
Gazing into my crystal ball I observed rn**@rediffmail.com writing in
news:11*********************@s34g2000cwa.googlegro ups.com:
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 entered by the user in the
JavaScript prompt dialog are retained by ASP?

Possibly having something to do with the fact that HTML collapses white
space. You could _try_ using style="white-space:pre"
[http://www.w3.org/TR/REC-CSS2/text.h...f-white-space] in the
input element to retain it.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jan 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mar Thomas | last post by:
I have a dom tree created from an XML document but it shows whitespaces as Textnodes!! Pls tell me how to get rid of them I tried ... ...
0
by: Prawdziwa Blondynka | last post by:
Hi, I would like to do the following with C++ and Xerces: set the schema path in an XML file to parse in this way: XMLCh* schemaLocation =...
1
by: Dave | last post by:
Hi Have a method that builds and returns a of specfic accounting codes to a datagrid textbox field. eg, if a user types in "200" the method...
1
by: asjad | last post by:
Is there is any way that i can show whitespaces in my editor, made by extending rich text box.
1
by: rj | last post by:
Hello, I try to remove whitespaces from a string using the preg_replace function like preg_replace("/*/"," ",$string); This works great,...
6
by: mardif | last post by:
Hi guys. I've a very big big big problem: I've in my windows computer a file named cicciobello.html, located in c:\documents and...
6
by: mathieu.malaterre | last post by:
Hello, I cannot figure out a way to find a regular expression that would match one and only one of these two strings: s1 = ' ...
2
by: rn5a | last post by:
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...
5
by: mishink7 | last post by:
i was wondering how would u remove multiple whitespaces from the middle of a string to make it only one white space...for example: string hi= "hi ...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.