Results 1 to 12 of 12

Thread: Radio button
      
   

  1. #1
    Lisjachij is offline Private First Class
    Join Date
    Jun 2008
    Posts
    9

    Default Radio button

    Please provide me with step-by-step instructions on how to accomplish the following task. I create two Radio buttons (or option buttons), let say button A and button B and one simple button. Question: how to connect simple button with Radio buttons so that if I select Radio button A I'm redirected to Page 1 and if I select Radio button B I'm redirected to Page 2.

  2. #2
    adele1972's Avatar
    adele1972 is offline Major
    Join Date
    Nov 2007
    Posts
    285

    Smile Re: Radio button

    Quote Originally Posted by Lisjachij View Post
    Please provide me with step-by-step instructions on how to accomplish the following task. I create two Radio buttons (or option buttons), let say button A and button B and one simple button. Question: how to connect simple button with Radio buttons so that if I select Radio button A I'm redirected to Page 1 and if I select Radio button B I'm redirected to Page 2.
    hi
    click on button properties, then add the link to button 2
    ie www.yoursitename.com/whateveryoucalledthepage.html

    link the button to the page you would like it to go to!

  3. #3
    Lisjachij is offline Private First Class
    Join Date
    Jun 2008
    Posts
    9

    Default Re: Radio button

    It doesn't answer my question. What should I set in properties of Radio buttons (Group name, Value, Events) to connect it with simple button, so if I choose Radio button 1 and then click simple button I'm redirected to page 1 and if I choose Radio button 2 I'm redirected to page 2

  4. #4
    D'son's Avatar
    D'son is offline Major General
    Join Date
    Apr 2008
    Location
    Illinois
    Posts
    2,580

    Default Re: Radio button

    Place the button where you like, double click the button. When the properties box opens, name the button appropriately, go to the events tab, click add, under the event drop list select "on click", leave the action "show", and type in the full address of the page you want to link too in the target box, click ok. Repeat this for each button.

  5. #5
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Red face Re: Radio button

    The only way to do that is with Javascript.
    let me explain: the radio buttons, by themselves, and the button, need to be related, and the simplest way to do that is that they are all part of a form.
    So your button should be a "Submit" one. You add, in the Inside Tag of the radio buttons html :

    "onclick="changeaction()"



    Now you should write this simple Javascript (changeaction) that will check the value of the radio buttons and will change the form action accordingly, to send to either page 1 or page 2.

    If you look at the code of the Go Menu, you will get some ideas on how this function should be structured.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  6. #6
    Lisjachij is offline Private First Class
    Join Date
    Jun 2008
    Posts
    9

    Default Re: Radio button

    Thank you very much for your reply, you seems to be the only one who understand what I want to perform. Could you help me writing this simple javascript? Unfortunately I couldn't solve it by myself.

  7. #7
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Radio button

    Ok.

    Place the two radio buttons on your form. Call them, in example, "url" . Now, right click the first and paste the following code in the Inside Tag of it's html:

    onclick="changeaction1()"

    Repeat for the second one, but the code should be:

    onclick="changeaction2()"

    Now, copy the following code and paste it in the Inside Head Tag of the Page HTML:

    <script language="JavaScript" type="text/javascript">
    function changeaction1()
    {
    document.forms[0].action = '
    http://www.dbtechnosystems.com' ;
    }
    function changeaction2()
    {
    document.forms[0].action = '
    http://www.navaldesign.info' ;
    }
    </script>
    You can see, in red, the URLs that i have used in this example, replace them with your own. If you have more than two radio buttons, add code accordingly.


    Test it in http://www.dbtechnosystems.com/Tips/change_action.php


    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  8. #8
    Lisjachij is offline Private First Class
    Join Date
    Jun 2008
    Posts
    9

    Default Re: Radio button

    Thank you very much! Everything works just great! I had only to change 0 to 1 in javascript code (document.forms[0].action change to document.forms[1].action), because I had another form on the page.

    I have another question concerning this second form. The form was created by means of Form Wizard from template Support. I entered my e-mail address into this form but when I preview the page and click Submit I have error: File not found. Firefox can't find the file at /C:/DOCUME~1/MyComputerName/LOCALS~1/Temp/preview/<? echo($_SERVER['PHP_SELF']);?>.

  9. #9
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Radio button

    The pages with forms created with the form wizard are php. This means that they will ONLY work (submit) when published, because php doesn't work on your own computer. It will work when published.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  10. #10
    Lisjachij is offline Private First Class
    Join Date
    Jun 2008
    Posts
    9

    Default Re: Radio button

    Thank you very much, I just can't bother you any more...

  11. #11
    willow315 is offline Private
    Join Date
    Aug 2008
    Posts
    1

    Default Re: Radio button

    This is exactly what I want to do, but I don't understand the instructions. When you say, "Place the two radio buttons on your form. Call them, in example, "url" . Now, right click the first and paste the following code in the Inside Tag of it's html:" What do you mean by 'Inside Tag of it's HTML' I see nothing anywhere called, "Inside Tag." What are you talking about? also, What do you set the initial action in the form code to? EG, <form action=""....what should go there?

    Here's the code for my simple form: Can you clarify your instructions?

    <form action="" method="post" name="PledgeDistrib" id="PledgeDistrib">

    <table width="472">
    <tr>
    <td width="183"><label>
    <input name="SupportWUSF" type="radio" id="SupportWUSF_0" value="GiveFM">
    <span class="BLKSubhdSmall">GIVE TO WUSF 89.7</span></label></td>
    <td width="192"><input type="radio" name="SupportWUSF" value="GiveTV" id="SupportWUSF_1">
    <span class="BLKSubhdSmall">GIVE TO WUSF TV/DT</span></td>
    <td width="81"><input type="submit" name="Submit" id="Submit" value="Go"></td>
    </tr>
    </table>
    </form>

    Thanks, WCW

  12. #12
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Radio button

    When you right click a Radio Button, select, from the menu that appears, "HTML". Then you will see the tags. Click on "Inside Tag" and paste the code in the lower window.

    However, these instructions are for BV forms, the above is not.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49