Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | 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 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 Search this Thread Display Modes
  #1 (permalink)  
Old July 29th, 2003, 12:20 AM
Authorized User
 
Join Date: Jun 2003
Location: , , India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default Passing Parameter

I have two radio buttons and an hyperlink in my form. when i am clicking the hyperlink i want to pass an value to the form, to indicate which radio button is selected.I don't want to submit the form because i am opening the form as an popup.
is there a way to do it.Please provide some sample code
Thanks
T.Gopalakrishnan
Reply With Quote
  #2 (permalink)  
Old July 29th, 2003, 04:02 AM
Authorized User
 
Join Date: Jun 2003
Location: Quezon City, MM, Philippines.
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

Sounds a little confusing : do you want to click one of the radio buttons first before you click on the hyperlink?

Cheers!
Marlon
Reply With Quote
  #3 (permalink)  
Old July 29th, 2003, 04:16 AM
Authorized User
 
Join Date: Jun 2003
Location: , , India.
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default

Hai
Sorry for the confusion.i am first going to select an radio button after that i am going to click on the hyperlink.While clicking the hyperlink i want to pass which radio button is selected as an parameter to the form.
Thanks
T.Gopalakrishnan
Reply With Quote
  #4 (permalink)  
Old August 7th, 2003, 07:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Moharo
Default

you might want to do something like this:


<form name="myform">
<input type="radio" name="myradio" value="1">1
<input type="radio" name="myradio" value="2">2
</form>

<a href="javascript:readAndSend();">Send it</form>

<script language="JavaScript">

var selection = null;

function readAndSend() {
    for(i=0;i<document.getElementById("myform").elemen ts.length;i++) {
        if(document.getElementById("myform").elements[i].type == "radio") {
             if(document.getElementById("myform").elements[i].checked) {
                  //store the value of a checked radio button
                  selection = document.getElementById("myform").elements[i].value; }
                                                                                 }
                                                                             }
    if(selection != null) window.open('otherpage.html?pick=' + selection);
    else alert("please make a selection");
}

</script>

:):D:D:D

the genuine genius
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
passing parameter sarah lee ASP.NET 1.0 and 1.1 Basics 3 September 5th, 2006 04:29 PM
problem with passing parameter hertendreef ADO.NET 0 June 23rd, 2006 10:00 AM
Passing a Date Parameter ego_mouse BOOK: Professional Crystal Reports for VS.NET 1 January 27th, 2005 08:12 AM
passing parameter.. suzila VB.NET 2002/2003 Basics 7 May 17th, 2004 08:28 PM
Parameter passing psambor Beginning PHP 0 September 17th, 2003 01:47 AM



All times are GMT -4. The time now is 06:29 AM.


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