Results 1 to 3 of 3

Thread: Dropdown Parent & Child option list and on submit load a page

  1. #1
    Join Date
    Dec 2016
    Location
    London
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Dropdown Parent & Child option list and on submit load a page

    Hi

    i am new to here, and i am trying to create a list of team member & their location in two different dropdown list, and on submit it should load a new page where it should list appropriate people according the options selected on the list,

    i got the drop down selected with the following code but i don't know how to get a page load

    Code:
    <!DOCTYPE html>
    <html>
    <body>
    
    <form action="demo_form.asp">
    <select name="Region">
      <option value="London">London</option>
      <option value="saab">Saab 95</option>
      <option value="mercedes">Mercedes SLK</option>
      <option value="audi">Audi TT</option>
    </select>
    
    <select name="Area of Tax:">
      <option value="Private Clients">Private Clients</option>
      <option value="saab">Individual Tax Returns</option>
      <option value="mercedes">US Business Expansion</option>
      <option value="audi">Corporate Tax</option>
      <option value="audi">Trusts & Estates</option>
      <option value="audi">FATCA</option>
      <option value="audi">Tax Consultancy</option>
    </select>
    
    
    
    <input type="submit" value="Submit">
    </form>
    
    <p>Choose a Region and Area of Tax your looking for and  click the "Submit" button </p>
    
    </body>
    </html>
    i may be wrong on the above code, please correct me.
    thank you
    Sellar
    Last edited by jscheuer1; 12-18-2016 at 01:29 PM. Reason: format code

  2. #2
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    You should start by reading this page and trying the examples:

    http://www.w3schools.com/php/php_forms.asp

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In the html code from your post all the action would take place on the demo_form.asp page. That's assuming your host supports asp. If it does, that page could do various things based upon the GET request that the form would deliver to it. It could load various pages, or load (present) content based upon it. There are various ways one could utilize a form like that, with or without asp. Do you have asp or another server side language? If not, or if you don't want to use server side code, javascript could be used.

    Here's a working example using javascript and jQuery:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Example redirect using jQuery</title>
    </head>
    <body>
    
    <form id="redirectform">
    <select name="Region">
      <option value="london">London</option>
      <option value="paris">Paris</option>
      <option value="rome">Rome</option>
      <option value="salerno">Salerno</option>
    </select>
    
    <select name="Area_of_Tax">
      <option value="private_clients">Private Clients</option>
      <option value="individual_tax_returns">Individual Tax Returns</option>
      <option value="us_business_expansion">US Business Expansion</option>
      <option value="corporate_tax">Corporate Tax</option>
      <option value="trusts_and_estates">Trusts &amp; Estates</option>
      <option value="FATCA">FATCA</option>
      <option value="tax_consultancy">Tax Consultancy</option>
    </select>
    
    
    
    <input type="submit" value="Submit">
    </form>
    
    <p>Choose a Region and Area of Tax your looking for and  click the "Submit" button </p>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script>
    jQuery(function($){
    	$('#redirectform').submit(function(e){
    		window.location.href = this.elements.Region.value + '_' + this.elements.Area_of_Tax.value + '.html';
    		e.preventDefault();
    	});
    });
    </script>
    </body>
    </html>
    Last edited by jscheuer1; 12-18-2016 at 03:14 PM. Reason: add example
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Replies: 7
    Last Post: 06-28-2012, 07:56 PM
  2. Using dropdown list option to select tab menu content
    By veiga in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 11-11-2011, 04:35 PM
  3. Child windows not closing after refreshing parent page
    By mohdanis2011 in forum JavaScript
    Replies: 1
    Last Post: 11-30-2010, 04:15 AM
  4. Replies: 2
    Last Post: 01-23-2010, 01:25 AM
  5. Activating parent page link from 'child page'
    By pamcse in forum JavaScript
    Replies: 1
    Last Post: 06-07-2005, 01:53 PM

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
  •