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 2 of 2
  1. #1
    Cez
    Cez is offline
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form help - problems with 'Select' function

    Hi, firstly thank you to anyone who can help me with this problem. I am currently working on a website re-design for an estate agent that uses www.vebra.com software to power their search function.

    I don't have access to the back end code that powers the form that can be found at the following link http://www.vebra.com/home/solex/sear...d=1&norefine=1

    I am able to however, copy the form options and use them in the newly designed site. The bit I'm having problems with is converting the Regions checkboxes into a drop down menu (using the select option) so that it's more compact. See image below.



    The current code that the site uses is.

    Code:
    <input type="checkbox" name="aloHorsforth LS18" id="aloHorsforthLS" value="Horsforth LS18" ><span class="spanclick" onclick="CheckClick(aloHorsforthLS);">Horsforth LS18</span>
    <input type="checkbox" name="aloRawdon LS19" id="aloRawdonLS" value="Rawdon LS19" ><span class="spanclick" onclick="CheckClick(aloRawdonLS);">Rawdon LS19</span>
    <input type="checkbox" name="aloGuiseley LS20" id="aloGuiseleyLS" value="Guiseley LS20" ><span class="spanclick" onclick="CheckClick(aloGuiseleyLS);">Guiseley LS20</span>
    <input type="checkbox" name="aloCookridge LS16" id="aloCookridgeLS" value="Cookridge LS16" ><span class="spanclick" onclick="CheckClick(aloCookridgeLS);">Cookridge LS16</span>
    <input type="checkbox" name="aloCalverley LS28" id="aloCalverleyLS" value="Calverley LS28" ><span class="spanclick" onclick="CheckClick(aloCalverleyLS);">Calverley LS28</span>
    <input type="checkbox" name="aloYeadon LS19" id="aloYeadonLS" value="Yeadon LS19" ><span class="spanclick" onclick="CheckClick(aloYeadonLS);">Yeadon LS19</span>
    <input type="checkbox" name="aloAdel LS16" id="aloAdelLS" value="Adel LS16" ><span class="spanclick" onclick="CheckClick(aloAdelLS);">Adel LS16</span>
    <input type="checkbox" name="aloKirkstall LS5" id="aloKirkstallLS" value="Kirkstall LS5" ><span class="spanclick" onclick="CheckClick(aloKirkstallLS);">Kirkstall LS5</span>
    <input type="checkbox" name="aloIreland Wood LS16" id="aloIrelandWoodLS" value="Ireland Wood LS16" ><span class="spanclick" onclick="CheckClick(aloIrelandWoodLS);">Ireland Wood LS16</span>
    I've tried changing it using the following format

    Code:
    <select name="location">
    <option name="aloHorsforth LS18" id="aloHorsforthLS" value="Horsforth LS18"><span class="spanclick" onclick="CheckClick(aloHorsforthLS);">Horsforth LS18</span></option>
    <option name="aloRawdon LS19" id="aloRawdonLS" value="Rawdon LS19"><span class="spanclick" onclick="CheckClick(aloRawdonLS);">Rawdon LS19</span></option>
    </select>
    but this just returns all the properties

    I've found that if change the name in the select tag, it returns properties in Horsforth but that's it. If I change the name in the select tag code to the name of a particular area (eg aloRawdon LS19, aloKirkstall LS5) then it returns results for that region.

    Code:
    <select name="aloHorsforth LS18">
    <option name="aloHorsforth LS18" id="aloHorsforthLS" value="Horsforth LS18"><span class="spanclick" onclick="CheckClick(aloHorsforthLS);">Horsforth LS18</span></option>
    <option name="aloRawdon LS19" id="aloRawdonLS" value="Rawdon LS19"><span class="spanclick" onclick="CheckClick(aloRawdonLS);">Rawdon LS19</span></option>
    </select>
    I need the results to return the value of whatever option is selected from the dropdown but can't figure out how to do it.

    Thank you in advance

  • #2
    Banned
    Join Date
    Mar 2013
    Posts
    139
    Thanks
    0
    Thanked 9 Times in 9 Posts
    Form data (from selects, inputs etc) are sent to the server in name/value pairs. So for a select, you give the select a name and each option a value. You don't give a name to each option.

    When the form is submitted the select's name and the value of the selected option(s) are sent to the server.


  •  

    Posting Permissions

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