PDA

View Full Version : script for combo box



sandra
10-29-2007, 07:22 AM
i used a combo box with go bottom (put our products in that combo box so the others should select one of them and press on go bottom to link to related page)

i used bellow code. would you please help me to use this combo box without go bottom?

use this style in head tag:
<style>
.jc{
position:relative;
}

.comboStyle { border-style:groove; border-width:3; font-family: Tahoma; font-size: 12; background-color: #FFFFFF}
.hLight00 { background-color: #F3F8FE}
.hLight01 { background-color: #FFF9F9}

</style>



and use this form combo box:
<form>
<p dir="rtl" style="margin-left: 5; margin-right: 5; margin-top:10px; margin-bottom:2px" class="matnPar_fa">
<select size="1" name="cmbItemSelect" dir="ltr" class="comboStyle" style="font-size: 11">
<option selected value="0">[
product ]</option>
<option value="page link 1">
product 1
</option>
<option value="page link 2">
product 2
</option>

</select></p>
<p align="center" dir="rtl" style="margin-left: 5; margin-right: 5; margin-top:5px; margin-bottom:2px" class="matnPar_fa">
<span style="font-weight: 400">
<input type="button" value="جستجو " name="btmSubmit" style="font-family: Tahoma; font-size: 10px" onclick="if(cmbItemSelect.value!='0'){window.location.href=cmbItemSelect.value;} return false;"></span></p>
</form>

Bob90
10-29-2007, 10:59 AM
<form>
<p dir="rtl" style="margin-left: 5; margin-right: 5; margin-top:10px; margin-bottom:2px" class="matnPar_fa">
<select size="1" name="cmbItemSelect" dir="ltr" class="comboStyle" style="font-size: 11">
<option selected value="0">[
product ]</option>
<option value="page link 1">
product 1
</option>
<option value="page link 2">
product 2
</option>

</select></p>
<p align="center" dir="rtl" style="margin-left: 5; margin-right: 5; margin-top:5px; margin-bottom:2px" class="matnPar_fa">
<span style="font-weight: 400">
<input type="button" value="جستجو " name="btmSubmit" style="font-family: Tahoma; font-size: 10px" onclick="if(cmbItemSelect.value!='0'){window.location.href=cmbItemSelect.value;} return false;"></span></p>
</form>

I think you can just do this



<select size="1" name="cmbItemSelect" dir="ltr" class="comboStyle"
onchange="if(this.value!='0'){window.location.href=this.value;}
style="font-size: 11">
<option selected value="0">[
product ]</option>
<option value="page link 1">
product 1
</option>
<option value="page link 2">
product 2
</option>
</select>

sandra
10-29-2007, 02:08 PM
Thanks for your great help. it is work correctly.
:)