Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 7th, 2008, 07: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 Search this Thread
Search this Thread:

Advanced Search
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 08:19 AM
Using getElementById Frank Huddleston XML 4 November 11th, 2005 01:44 PM
getElementByID error lian_a Javascript How-To 1 December 21st, 2004 01: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 01:01 AM.


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