Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    select and go menu probs

    I hope I am posting in the right place, if not my apologies.

    Gotta simple select and go script working fine, but I want to offer similar functionality for visitors without javascript.


    Code:
    <onload= "document.myForm.newLocation.selectedIndex=0">
    <div align="center">
    <form action="gotoLocation.cgi" name="myForm">
    	<select name="newLocation" onchange="jumpPage(this)">
    	<option selected="selected">
    	Select your State</option>
    	<option value="index.php/CPT/Online-Certification/Approved.html">
    	Alabama</option>
    	<option value="index.php/CPT/Online-Certification/Sorry.html">
    	Alaska</option>
    
    
    <noscript>
    	<input type="submit" value="Find Out!" />
    	</noscript>
    This almost works, as when I test with javascript disabled, a submit button is created ("Find Out!") and the visitor is sent to a new url.

    Unfortunately, the new url is not the same as the url indicated in the code,
    example:

    should look like this:

    index.php/CPT/Online-Certification/Approved.html

    but ends up looking like this:

    gotoLocation.cgi?newLocation=index.php%2FCPT%2FOnline-Certification%2FApproved.html

    I just need to figure out how to remove the extra words/symbols from the urls.

    You can see it in action at http://certifiedpooltechnician.com

    There are two pull downs on the page, both the same code.

    Thank you in advance for your assistance!

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,292
    Thanks
    10
    Thanked 583 Times in 564 Posts
    can you post the source for the function jumpPage() ?

    without javascript, the browser will redirect to the action url of the form tag, so that's a php question.
    you will need to transfer or forward the session in a script at that url, based upon the querystring.
    Last edited by rnd me; 06-17-2008 at 09:15 PM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  • #3
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for taking the time to help, rnd me.

    Is the following what u mean?

    Code:
    <script language="Javascript" type="text/javascript">
    <!-- Hide script from older browsers
    function jumpPage(newLoc) {
    newPage = newLoc.options[newLoc.selectedIndex].value
    if (newPage != ""){
    window.location = newPage
    }
    }
    I think the prob is that I don't have a cgi script loaded on my server, but I don't know exactly what I need or where to put it.

    Thanks again for any help. I am new to this so I really apprecitate your patience.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    but ends up looking like this:

    gotoLocation.cgi?newLocation=index.php&#37;2FCPT%2FOnline-Certification%2FApproved.html
    You can see it in action at http://certifiedpooltechnician.com
    When I select Alabama, I reach at http://certifiedpooltechnician.com/i.../Approved.html, and see "Approved" message. The url is also fine.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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