Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-03-2009, 06:44 PM   PM User | #1
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
Colons in "id" tags give jQuery fits

I was using an id name of "TEST:002:INPUT" on an entry field, which is technically valid, but I could not pull the value of the entry field using $("#TEST:002:INPUT").val(); -- was just returning "undefined". Once I changed the colons to underlines, I was able to pull the value with no problem.

It only took me 2 hours to figure out what the problem was
__________________
Fumigator is offline   Reply With Quote
Old 08-05-2009, 04:26 AM   PM User | #2
Iszak
Regular Coder

 
Iszak's Avatar
 
Join Date: Jun 2007
Location: Perth, Western Australia
Posts: 332
Thanks: 2
Thanked 58 Times in 57 Posts
Iszak is an unknown quantity at this point
You need to escape the colon by using a double backslash.

E.g.
Code:
$('#TEST\\:002\\:INPUT').val();
Or simply use underscores like you did, but why compromise!
Iszak is offline   Reply With Quote
Users who have thanked Iszak for this post:
Fumigator (08-05-2009)
Old 08-05-2009, 03:14 PM   PM User | #3
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
Well dang I should have tried that, once I figured out the colons were a problem. By then, I just wanted the stupid thing to work so I was happy to just switch to underlines! But thanks for the tip
__________________
Fumigator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:56 PM.


Advertisement
Log in to turn off these ads.