Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6
This is the forum to discuss the Wrox book Professional Ajax, 2nd Edition by Nicholas C. Zakas, Jeremy McPeak, Joe Fawcett; ISBN: 9780470109496
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 7th, 2008, 06:17 PM
Registered User
 
Join Date: Apr 2007
Location: Milano, , Italy.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Radio controls and getElementById

Good morning, I'm trying the getElementById function in a document, but I have a problem with radio controls.
I'd like to get the radio control selected, but it always return me the first radio button and then the value London.
What's the right syntax?

Thanks in advance

My HTML is
<input type="radio" name="city" id="city" value="London">London
<input type="radio" name="city" id="city" value="Madrid">Madrid
<input type="radio" name="city" id="city" value="Milan" checked>Milan


and my Javascript
var city = document.getElementById("city");
alert(city.value);


Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using typeOf with getElementById() atcs2152 Javascript 2 December 16th, 2005 07:19 AM
Using getElementById Frank Huddleston XML 4 November 11th, 2005 12:44 PM
getElementByID error lian_a Javascript How-To 1 December 21st, 2004 12:42 AM
'getElementById()' anshul Javascript How-To 1 September 1st, 2004 03:57 PM
document.getElementById(). PKC XSLT 0 July 21st, 2004 02:11 AM



All times are GMT -4. The time now is 12:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.