Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    11
    Member #
    32712
    I crated a form box just like the one on this site. http://www.progresspreferred.com/about_us.php

    The form on the left side "Get an Instant quote"

    Instead of the "Get a Quote" button i put the regular "Submit Form" button.

    <form action="" method="post" id="instant-quote"><table width="200" border="0">
    <tr>
    <td><span id="zip-code">
    <label for="zipCode"></label>
    <input type="text" name="zipCode" id="zipCode" tabindex="1" />
    <span class="textfieldRequiredMsg"><br />
    A value is required.</span></span></td>
    <td><label for="procuts"></label>
    <select name="procuts" id="procuts" tabindex="2">
    <option value="Auto" selected="selected">Auto</option>
    <option value="Trucks">Trucks</option>
    <option value="Home">Home</option>
    <option value="Contractors">Contractors</option>
    <option value="Business Owners">Business Owners</option>
    </select></td>
    </tr>
    <tr>
    <td><input type="submit" name="submit" id="submit" onclick="return next()" value="Continue" tabindex="3" /></td>
    <td>&nbsp;</td>
    </tr>
    </table>
    </form>

    NOW I want my visiters to select the insurance product (Auto, Home...) and click on the "submit" button and the submit button takes them to whatever option they chose on the drop down menu. Just the way it work on that website. How can this be done? What do I need to add in the code to make it work?

    Thank you

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    You would either need a JavaScript function to determine what selection the visitor actually selected

    Or

    A php script that reads the selected option on the page that you sent them to, and redirect them to the proper page

    Or

    The way i do it in asp, is send all the request, regardless of he selection, but depending on the selection, read the selection from the post command, and display the information based on that selection. If they hit the submit button without selecting anything, I bounce them back to the page with the options. Sure it can be done similarly with php, just not familiar enough with it to tell you how to do it.

  4. #3
    Junior Member
    Join Date
    Aug 2012
    Posts
    11
    Member #
    32712
    I want to the do it with javascript. just let them select and when they click on the button it redirects them to the location they have selected. Do you know how to do the code with javascript?

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    What If they ( the visitor ) ,has JavaScript turned off ? Yes, a lot of people do have it turned off.

    I always recommend using server side scripting like asp or php for major functionality components and JavaScript only on non site critical functionality.

  6. #5
    Junior Member
    Join Date
    Aug 2012
    Posts
    11
    Member #
    32712
    That is fine. im fine with javascript if you help me with the javascript code that would be great.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:58 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com