Wrox Programmer Forums
| 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
  #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);




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





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