473,782 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1986
Gazing into my crystal ball I observed rn**@rediffmail .com writing in
news:11******** *************@s 34g2000cwa.goog legroups.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
2357
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 ... factory.setIgnoringElementContentWhitespace(true); but it doesnt work! Help me please thanks
0
1315
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 = XMLString::transcode(namespaceAndPath); //namespaceAndPath stands for the namespace and schema path containing whitespaces parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation,
1
1769
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 builds & returns the code "200.00.00". also if a user types in "51" the method should return " 51.00.00" but I am finding difficulty adding a white space infront of the string, I have been using the PadLeft method eg: sCode = sCode.PadLeft(1, ' ') + ".00" + ".00";
1
2294
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
1702
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, but makes no handles all characters in the same way. I want to preserve data between double quotes. So, hello world "It is a sunny... world"
6
3687
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 settings\username\desktop\cicciobello.html. Now, I MUST open this file with os.spawn(os.P_WAIT ...., because I must wait the user cancel the explorer window, ok? And so, I write:
6
2111
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 = ' how are you' s2 = ' hello world how are you' All I could come up with was: patt = re.compile('^*(+)+(+)$')
2
1685
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 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...
5
2325
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 bye"; then remove the multiple whitespaces in middle to make it "hi bye" any help would be appreciated...thanks.
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.