Selction in combobox in a from to perform if / then

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rob (SA)
    Lieutenant Colonel

    • Nov 2006
    • 586

    Selction in combobox in a from to perform if / then

    Hi Folks,

    I have a form created through ABVFP and on that form I have two combobox's (1) select handicap and the other (2) the divison in which that specific handicap will play.

    I thus have to make two selection where the process could be simplified as the handicaps range form +5(best) to 36(worst)

    There are only three divisions (A,B and C) and their range is +5 to 9, 10 to 18 and 18 to 36 respectively.

    My thought is that an IF/THEN statment is possible using the combobox 1 and the differention made immediately of the division, that the two fields in MySQL can be populated using only one selction and thus reducing the need for the 2nd combobox.

    Any advice / help in getting this to work would be appreciated.

    My current combo box html info looks like this

    PHP Code:
    <select name="My Handicap is" size="1" id="Combobox6" style="position:absolute;left:254px;top:218px;width:64px;font-family:Arial;font-weight:bold;font-size:11px;z-index:42">
    <
    option value=" "> </option>
    <
    option value="+3">+3</option>
    <
    option value="+2">+2</option>
    <
    option value="+1">+1</option>
    <
    option value="0">0</option>
    <
    option value="1">1</option>
    <
    option value="2">2</option>
    <
    option value="3">3</option>
    <
    option value="4">4</option>
    <
    option value="5">5</option>
    <
    option value="6">6</option>
    <
    option value="7">7</option>
    <
    option value="8">8</option>
    <
    option value="9">9</option>
    <
    option value="10">10</option>
    <
    option value="11">11</option>
    <
    option value="12">12</option>
    <
    option value="13">13</option>
    <
    option value="14">14</option>
    <
    option value="15">15</option>
    <
    option value="16">16</option>
    <
    option value="17">17</option>
    <
    option value="18">18</option>
    <
    option value="19">19</option>
    <
    option value="20">20</option>
    <
    option value="21">21</option>
    <
    option value="22">22</option>
    <
    option value="23">23</option>
    <
    option value="24">24</option>
    <
    option value="25">25</option>
    <
    option value="26">26</option>
    <
    option value="27">27</option>
    <
    option value="28">28</option>
    <
    option value="29">29</option>
    <
    option value="30">30</option>
    <
    option value="31">31</option>
    <
    option value="32">32</option>
    <
    option value="33">33</option>
    <
    option value="34">34</option>
    <
    option value="35">35</option>
    <
    option value="36">36</option
    Kind Regards
    Rob
    www.gnjgf.co.za
    www.oryan-projects.com
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Selction in combobox in a from to perform if / then

    Yes, it is possible, and can be done in two ways:

    1. Using Javascript. You need to associate a "onChange" event on the first combobox that will trigger a Javascript function to automatically set the Division based on handicap division. This is done in page level.

    2. USing PHP. In this case you would need to modify the PHP code of ABVFP to perform the if / then check and populate the $_POST['division'] value, leaving ABVFP to do the MySQL population.

    I provided you hints on the two possibilities you have.However, providing the acual code is out of the scopes of this forum.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • Rob (SA)
      Lieutenant Colonel

      • Nov 2006
      • 586

      #3
      Re: Selction in combobox in a from to perform if / then

      Hi George,

      As usual you come to the rescue, thanks for the prompt reply.

      May I approach you privately to do this for me.
      Kind Regards
      Rob
      www.gnjgf.co.za
      www.oryan-projects.com

      Comment

      Working...
      X