SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict einSTein's Avatar
    Join Date
    Aug 2006
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Radion Buttons error

    the error here that if i gave each radio button different name the function will work but if i gave all the radio button the same name but different values the function stop working ...... please help i need to make that form with same name radio buttons but different values
    Code JavaScript:
    <script type="text/JavaScript">
     
    <!--
     
    function OU()
    {
    day = new Date();
    id = day.getTime();
    x=document.form1
    fn = x.a.value
    alert (fn)
    ln = x.k.value
     
    submitOK="True"
    var url="vote.php"
    url=url+"?qid="+fn
    url=url+"&R1="+ln
    alert (url)
    eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=0,resizable=0,width=750,height=200,left = 301,top = 332');");
    }
    //-->
    </script>
    Code HTML4Strict:
    <form method="POST" name="form1" action="" onsubmit="OU()">
    	<p dir="rtl" align="left">a<input type="radio" value="a" name="k"><br>
    	b<input type="radio" value="b" name="k"><br>
    	c<input type="radio" value="c" name="k"><br>
    	d<input type="radio" value="d" name="k"><br>
    	&nbsp;</p>
    	<p align="left"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First, your relying a lot on javascript to pass the values along in a url, which just makes things over complicated. Take a gander at the reply I made on this post for a simpler solution. This person was trying to achieve the same thing as you.

    http://www.sitepoint.com/forums/showthread.php?t=515060
    intragenesis, llc professional web & graphic design


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •