Forums

Help with dynamic form. I'm doing something wrong.

baxterdown 10 Feb, 2011
Hi, good afternoon.

I created a dynamic form using usableforms.js and its sample form and tested it. It works OK (thanks Bob for your help!).

Now, I've created the real form and cannot get it to work. The first field is a dropdown. If the user selects "Apartments/Multi-Housing" the form should unhide the "Number of Laundry Machines" field.

I created a rel statement called "marketplace" (rel="marketplace") and placed it in the label tag of the dropdown as well as the option tag of Apartments/Multi-Housing.

The "Number of Laundry Machines" gets hidden ok, but I cannot get it to unhide when I select Apartments/Multi-Housing.

What am I doing wrong?


Here's my form code (you can see the form here)

Thanks for your help,

Jose

<script type="text/javascript" src="http://67.19.240.147/~mgraaxon/components/com_chronocontact/js/usableforms.js"></script>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label rel="marketplace" class="cf_label" style="width: 200px;">Your Marketplace</label>
    <select class="cf_inputbox validate-selection" id="select_27" size="1" title=""  name="marketplace">
    <option value="">Choose Option</option>
      <option rel="marketplace" value="Apartments/Multi-Housing">Apartments/Multi-Housing</option>
<option value="Academic Institutions">Academic Institutions</option>
<option value="Assisted Living Facilities">Assisted Living Facilities</option>
<option value="Athletic Facilities">Athletic Facilities</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div rel="marketplace" class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 200px;">Number of Laundry Machines</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_18" name="number_machines" type="text" />
  
  </div>
GreyHead 12 Feb, 2011
Hi baxterdown,

I'd try putting the rel attribute only in the <option> tag of the drop-down (not in the <label> or <select> tags) and add rel='none' to all the other options (see Step 5 on the Usable Forms docs).

Bob
baxterdown 12 Feb, 2011
That was it! Thanks Bob! As always, I really appreciate your help!!!!! :mrgreen:

Jose
GreyHead 27 Feb, 2011
Hi,

I've published a tutorial on creating Conditional ChronoForms using Usable Forms and Validation scripts from QuirksMode.org.

Please see this post for more information.

Bob
baxterdown 28 Feb, 2011
Thanks Bob. I just purchased it! :-)
This topic is locked and no more replies can be posted.