Hi All,
I am currently trying to display a drop down list dependent on the users selection in the first drop down list.
I have tried the following:
FORM HTML SECTION: (I have a call to a javascript function on change)
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Vehicle Type</label>
<select class="cf_inputbox validate-selection" id="select_5" size="1" title="Please choose your vehicle" name="select_5" onChange="pricing_call();>
<option value="">Choose Option</option>
<option value="1">Medium Car</option>
<option value="2">Toyota Hilux</option>
<option value="3">Toyota Hilux Cage</option>
<option value="4">Toyota HiAce</option>
<option value="5">Toyota Tarargo</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
EXAMPLE OF A NAMED DIV I WANT TO INITIALLY HIDE
<div class="div_select_20">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Car length of hire</label>
<select class="cf_inputbox validate-selection" id="select_20" size="1" title="" name="select_20">
<option value="">Choose Option</option>
<option value="1 day $61">1 day $61</option>
<option value="2 days $122">2 days $122</option>
<option value="3 days $153">3 days $153</option>
<option value="4 days $204">4 days $204</option>
<option value="5 days $255">5 days $255</option>
<option value="6 days $267">6 days $267</option>
<option value="7 days $288">7 days $288</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
FORM JAVASCRIPT SELECTION:
onload="document.getElementById("div_select_20").style.display='none';"
onload="document.getElementById("div_select_21").style.display='none';"
onload="document.getElementById("div_select_22").style.display='none';"
onload="document.getElementById("div_select_24").style.display='none';"
onload="document.getElementById("div_select_25").style.display='none';"
function pricing_call(){
// Make sure the element exists before calling it's properties
if (document.form1.select_5.value == 1) {
document.getElementById("select_20").style.display = 'inline';
} else {
document.getElementById("select_20").style.display = 'none';
}
===========================================================================================
Currently nothing seems to happen.
I can make this work in ASP using table row id's but less familiar with PHP/Joomla/Chrono working as a combo together.
Any help or guidance would be very appreciated.
I am currently trying to display a drop down list dependent on the users selection in the first drop down list.
I have tried the following:
FORM HTML SECTION: (I have a call to a javascript function on change)
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Vehicle Type</label>
<select class="cf_inputbox validate-selection" id="select_5" size="1" title="Please choose your vehicle" name="select_5" onChange="pricing_call();>
<option value="">Choose Option</option>
<option value="1">Medium Car</option>
<option value="2">Toyota Hilux</option>
<option value="3">Toyota Hilux Cage</option>
<option value="4">Toyota HiAce</option>
<option value="5">Toyota Tarargo</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
EXAMPLE OF A NAMED DIV I WANT TO INITIALLY HIDE
<div class="div_select_20">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Car length of hire</label>
<select class="cf_inputbox validate-selection" id="select_20" size="1" title="" name="select_20">
<option value="">Choose Option</option>
<option value="1 day $61">1 day $61</option>
<option value="2 days $122">2 days $122</option>
<option value="3 days $153">3 days $153</option>
<option value="4 days $204">4 days $204</option>
<option value="5 days $255">5 days $255</option>
<option value="6 days $267">6 days $267</option>
<option value="7 days $288">7 days $288</option>
</select>
</div>
<div class="cfclear"> </div>
</div>
FORM JAVASCRIPT SELECTION:
onload="document.getElementById("div_select_20").style.display='none';"
onload="document.getElementById("div_select_21").style.display='none';"
onload="document.getElementById("div_select_22").style.display='none';"
onload="document.getElementById("div_select_24").style.display='none';"
onload="document.getElementById("div_select_25").style.display='none';"
function pricing_call(){
// Make sure the element exists before calling it's properties
if (document.form1.select_5.value == 1) {
document.getElementById("select_20").style.display = 'inline';
} else {
document.getElementById("select_20").style.display = 'none';
}
===========================================================================================
Currently nothing seems to happen.
I can make this work in ASP using table row id's but less familiar with PHP/Joomla/Chrono working as a combo together.
Any help or guidance would be very appreciated.