Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 September 14th, 2007, 08:26 AM
Authorized User
 
Join Date: Aug 2007
Location: , Tamil Nadu, India.
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default radio button

how i get full radio button length with out using

radio button name?
i not like this
- - - - - - --


<input type=radio name="mybutton">
<inpuy type=button name=submit OnClick="fun1()">
-----
<script>
function fun1()
{
var len=document.mybutton.length;
}



</script>











  #2 (permalink)  
Old September 15th, 2007, 08:54 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I'm not sure what you are trying to avoid. You can use document.getElementsByName() though.

--

Joe (Microsoft MVP - XML)
  #3 (permalink)  
Old September 17th, 2007, 05:17 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi anwarraja!!

you can use getElementById too


Cheers :)

vinod
  #4 (permalink)  
Old September 18th, 2007, 08:18 PM
Registered User
 
Join Date: Sep 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ymaozi Send a message via MSN to ymaozi
Default

You look at a small section of my writing:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ÎÞ±êÌâÒ³</title>
    <script language="javascript">
    function fun1()
    {
    var button=document.getElementsByName("mybutton");
    alert(button.length);
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <input type="radio" name="mybutton" />
    <input type="radio" name="mybutton" />
    <input type="button" name="submit" onclick="fun1()" />
     </div>
    </form>
</body>
</html>



Similar Threads
Thread Thread Starter Forum Replies Last Post
Radio button gaurisharya C# 2005 2 March 16th, 2008 06:43 AM
Radio button Jolley_tolson Javascript 2 July 15th, 2007 05:50 AM
radio-button grstad HTML Code Clinic 3 February 28th, 2006 08:32 AM
Button acts depending on radio button values janise Access 4 March 10th, 2004 12:53 AM
radio button damnnono_86 Access 5 October 28th, 2003 02:17 AM





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