Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / September 2005

Tip: Looking for answers? Try searching our database.

javascript issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
abcd - 14 Sep 2005 00:20 GMT
I have a select control

<select>
<option value = "1"> abcd </option>
<option value = "1"> my&nbsp;Name </option>
<option value = "1"> your&nbsp;Name </option>
</select>

I am comparing the values of the text property of the select control....my
comparisions fails...how to handle that &nbsp; while comparing....

e.g.

var testString = "my Name"

how can I compare this with the option value for exact match....

any tips
Serge Baltic - 14 Sep 2005 17:03 GMT
Hello,

a> I am comparing the values of the text property of the select
a> control....my comparisions fails...how to handle that &nbsp; while
a> comparing....

Replace all the NBSP's with regular spaces before comparing, eg with

var replaced = original.replace(/ /, " ");

Note that in the above line the character between the slashes is the NBSP
char (Alt+0160 to type in) and the quoted char is a space.

(H) Serg
Steve Fulton - 15 Sep 2005 12:13 GMT
> Hello,
>
[quoted text clipped - 8 lines]
> Note that in the above line the character between the slashes is the NBSP
> char (Alt+0160 to type in) and the quoted char is a space.

Perhaps /\xa0/g would be more clear (and replace all non-breaking spaces).

Signature

Steve

If we were to wake up some morning and find that everyone was the same
race, creed and color, we would find some other cause for prejudice by
noon. -George D. Aiken


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.