Link to home
Start Free TrialLog in
Avatar of Larry Vollmer
Larry Vollmer

asked on

Building a URL

I have the following form - when the user clicks submit I want to build a link and go to that page. I am not sure how to do it, can anyone help me out?

<form name="FOOD" method="post" action="">
  <p>
    <select name="SearchCategory" style="width: 170px" size="8" class="indextxt">
      <option value="" selected>ALL CITIES</option>
      <option value="Airmont">Airmont</option>
      <option value="Ardsley">Ardsley</option>
      <option value="Armonk">Armonk</option>
      <option value="Baldwin Place">Baldwin Place</option>
    </select>
  </p>
  <p>
    <select name="SearchSubCategory" style="width: 170px" size="8" class="indextxt">
      <option value="" selected>ALL TYPES</option>
      <option value="American">American</option>
      <option value="Bakery">Bakery</option>
      <option value="Barbecue">Barbecue</option>
      <option value="Brazilian">Brazilian</option>
    </select>  
  </p>
  <p>
    <input type="text" name="SearchKeyword" id="SearchKeyword" class="indextxt" value="" size="21" maxlength="50">
  </p>
</form>



I need the choices to that the user selects to populate the URL and go to the following page:

http://www.website.com/food.php?tab=events&query=VenueFoodFind&site=ESD&tpl=VenueFoodSearch&SearchKeyword=&SearchCategory=&SearchSubCategory=&SubmitEvent=submit

SearchKeyword= VALUE OF --->    <input type="text" name="SearchKeyword" id="SearchKeyword" class="indextxt" value="" size="21" maxlength="50">

SearchCategory = VALUE OF --->    <select name="SearchCategory" style="width: 170px" size="8" class="indextxt">

SearchSubCategory = VALUE OF ---->     <select name="SearchSubCategory" style="width: 170px" size="8" class="indextxt">
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Like this:


<form name="FOOD" method="GET" target="_self" action="http://www.website.com/food.php?tab=events&query=VenueFoodFind&site=ESD&tpl=VenueFoodSearch">
  <p>
    <select name="SearchCategory" style="width: 170px" size="8" class="indextxt">
      <option value="" selected>ALL CITIES</option>
      <option value="Airmont">Airmont</option>
      <option value="Ardsley">Ardsley</option>
      <option value="Armonk">Armonk</option>
      <option value="Baldwin Place">Baldwin Place</option>
    </select>
  </p>
  <p>
    <select name="SearchSubCategory" style="width: 170px" size="8" class="indextxt">
      <option value="" selected>ALL TYPES</option>
      <option value="American">American</option>
      <option value="Bakery">Bakery</option>
      <option value="Barbecue">Barbecue</option>
      <option value="Brazilian">Brazilian</option>
    </select>  
  </p>
  <p>
    <input type="text" name="SearchKeyword" id="SearchKeyword" class="indextxt" value="" size="21" maxlength="50">
  </p>
     <input type="submit" name="SubmitEvent" value="submit" >
</form>



Avatar of Larry Vollmer
Larry Vollmer

ASKER

I don't see where the SearchKeyword, SearchCategory, and SearchSubcategory are in that URL

IE: it the user selects a keyword of FOOD, SearchCategory = Airmont, SearchSubcategory=American

The submit button would take you to this URL


http://www.website.com/food.php?tab=events&query=VenueFoodFind&site=ESD&tpl=VenueFoodSearch&SearchKeyword=FOOD&SearchCategory=AIRMONT&SearchSubCategory=AMERICAN&SubmitEvent=submit
Sorry, better check this:



<form name="FOOD" method="GET" action="http://www.website.com/food.php">
<input type="hidden" name="tab" value="events" >
<input type="hidden" name="query" value="VenueFoodFind" >
<input type="hidden" name="site" value="ESD" >
<input type="hidden" name="tpl" value="VenueFoodSearch" >
  <p>
    <select name="SearchCategory" style="width: 170px" size="8" class="indextxt">
      <option value="" selected>ALL CITIES</option>
      <option value="Airmont">Airmont</option>
      <option value="Ardsley">Ardsley</option>
      <option value="Armonk">Armonk</option>
      <option value="Baldwin Place">Baldwin Place</option>
    </select>
  </p>
  <p>
    <select name="SearchSubCategory" style="width: 170px" size="8" class="indextxt">
      <option value="" selected>ALL TYPES</option>
      <option value="American">American</option>
      <option value="Bakery">Bakery</option>
      <option value="Barbecue">Barbecue</option>
      <option value="Brazilian">Brazilian</option>
    </select>  
  </p>
  <p>
    <input type="text" name="SearchKeyword" id="SearchKeyword" class="indextxt" value="" size="21" maxlength="50">
  </p>
     <input type="submit" name="SubmitEvent" value="submit" >
</form>



Give the last proposal a try and tell me what you get in a browser when you press submit.

OK
ASKER CERTIFIED SOLUTION
Avatar of CLupo
CLupo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial