Results 1 to 2 of 2

Thread: Radio Button Redirect Help

  1. #1
    Join Date
    Mar 2012
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Radio Button Redirect Help

    Hi

    I'm hoping that I've submitted this post correctly and that some kind sole out there can help me with a small problem I have.

    I'm putting together a basic computer course for an organisation I belong to and found a good online mouse tutorial which I would like to run offline from a computer hardrive. I have saved the 32 pages of the tutorial to my hardrive and now need to reconfigure them so that each page redirects to the following page upon the relevant action by the student.

    Now when I started it was easy as the redirect occurs when the student clicks on a hyperlink so I just changed the hyperlink to the new address (ie my HD address for the relevant file) and that works fine.

    Then as the tutorial progresses it gets into Radio Buttons, Check Boxes and Drop Down Lists and I quickly found this was way beyond my level of expertise.

    As I understand it I need to edit the Javascript to change the Radio Button redirect address to the relevant file on my HD so I downloaded a free editor (KompoZer) and off I went. Thought I had discovered what I needed to do (change the address in brackets on the "onclick" line down near the bottom of the code) but that didn't work for not so obvious reasons to me. I then tried to do it with the auto redirect features of KompoZer but that didn't work either.

    I am assuming that it has something to do with "function leapTo" stuff up near the top of the code but the only thing I know now is that I'm totally lost.

    I trust I have clearly explained what I am trying to do and hope someone can show me what I need to do. I have included the code for one of the pages below, at least I hope I have.

    Thankyou
    Kevin

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <!-- saved from url=(0048)http://www.galesburglibrary.org/mouse/page20.htm --><!-- saved from url=(0068)http://www.ckls.org/~crippel/computerlab/tutorials/mouse/page20.html -->
      <title>page 20</title>
      <meta content="text/html; charset=windows-1252"
     http-equiv="Content-Type">
      <script language="JavaScript">
    
    <!-- Hide this script from old browsers --
    
    /*
    
       This script came from the 24 hour JavaScripts Site
    
    located at http://www.javascripts.com.  It is brought to 
    
      you by Eric Jarvies, Lewis Sellers, Giuseppe Lombardo, 
    
              Kurt Anderson, and David Medinets. 
    
    */
    
    function leapTo (link)
    
       {
    
       var new_url=link;
    
       if (  (new_url != "")  &&  (new_url != null)  )
    
          window.location=new_url;
    
       else
    
          alert("\nYou must make a selection.");
    
       }
    
    
    
    // -- End Hiding Here -->
    
      </script>
      <meta name="GENERATOR" content="MSHTML 9.00.8112.16441">
    </head>
    <body bgcolor="#ffffff">
    <center>
    <table borders="0">
      <tbody>
        <tr valign="top">
          <td><font size="4">Click here <a
     href="http://www.galesburglibrary.org/mouse/page1.htm">to
    redo that last part of Mousercize</a> before doing something new.
          <br>
          <br>
    The circles below are <b>radio buttons</b>. </font>
          <p><font size="4"> </font></p>
          <form action="test"><font size="4"><input
     name="radio1" value="value3" checked="checked"
     type="radio">Button 1
    &nbsp;&nbsp;&nbsp;&nbsp;<input name="radio1"
     value="value4" type="radio">Button 2
    &nbsp;&nbsp;&nbsp;&nbsp;<input name="radio1"
     value="value5" type="radio">Button 3<br>
            <br>
    Click on each one. </font>
            <p><font size="4">Notice that only one radio
    button can be "on" at same time. <br>
            <br>
    To move to the next page, click on the radio button below. </font></p>
            <center><font size="4"> </font>
            <form><font size="4"><input
     onclick="leapTo('page21.htm')" name="buttons1"
     type="radio"><b>21</b> </font></form>
            </center>
          </form>
          </td>
        </tr>
      </tbody>
    </table>
    </center>
    </body>
    </html>

  2. #2
    Join Date
    Apr 2008
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post

    Default

    I have done a little bit of testing for you, your script actually works under the following conditions

    Internet Explorer from server
    Firefox from server
    Firefox from local machine

    But it does not work for Internet Explorer on a local machine, at this stage I am not certain why, possibly an inbuilt security block in Internet Explorer, hopefully someone else may know how to make it work in IE locally

  3. The Following User Says Thank You to dragon_sa For This Useful Post:

    BigKev (03-08-2012)

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
  •