Page 1 of 1

Need Simple Help Fixing Form

Posted: Thu Mar 11, 2010 12:39 pm
by soma56
I have a form I'm developing for a window/eaves cleaning company that has a unique request that I'd like to implement into their free quote for. Basically, what they want is the form to update the price of eavestrough cleaning when they select a specific size from a drop-down menu for their house. Here's a snippet of the code which should further explain what I'm trying to do:

Code: Select all

<td style="text-align:right;">What type of place do you have?</td>
        <td><select name="house" id="house">
          <option>Please Select</option>
          <option value="Bungalow">Bungalow</option>
          <option value="Semi Detached Bungalow">Semi Detached Bungalow</option>
          <option value="2 storey Semi Detached">2 storey Semi Detached</option>
          <option value="2 storey Detached">2 storey Detached</option>
          <option value="Side or Back Split">Side or Back Split</option>
         <option value="other">Commercial/Other</option>
        </select>
        </td>
      </tr>
      
      <td style="text-align:right;">
<input type="checkbox" name="asap" value="Yes">
      Would you like your eaves cleaned for $<!--ENTER DYNAMIC VALUE HERE--></td></tr>
Basically if Bungalow is chosen then the eaves cleaning price on the page would be updated to "X"
if Semi Detached Bungalow is chosen then the eaves cleaning price on the page would be updated to "Y"
if 2 storey Semi Detached is chosen then the eaves cleaning price on the page would be updated to "Z"
etc.,etc.

If anyone has any ideas on how I could accomplish this or could point me in the right dircetion then I would greatly appreciate it :)

Re: Need Simple Help Fixing Form

Posted: Thu Mar 11, 2010 2:11 pm
by cpetercarter
This is a job for Javascript. Very briefly, you need to give the html element which contains your dynamic value a unique id. Then you need to write an "onchange" event handler for the select box, which will rewrite the dynamic value according to the house type selected.

Re: Need Simple Help Fixing Form

Posted: Tue Apr 06, 2010 11:11 am
by soma56
Thank you, I'll track down a javascript forum and see what they say