monclrmudf
New Member
how do i disabled some dynamically drop down select option using java script i have java script function that can be passing drop down select option to the url but problem is that \[code\]<option>Select</option>\[/code\] also passing to the url now how could i disabled \[code\]<option>Select</option>\[/code\] while passing the select option values to the url? i want to send only name to the url except \[code\]<option>Select</option>\[/code\]?\[code\]function getComboC(sel) { var name=document.getElementById("name");var input_val = document.getElementById("name").value;name.action = "searchexpense.php?name="+input_val+"";name.submit();<form name="name" id="name"><select class="select10" name="pname" id="name" style="width:150px;" onChange="getComboC(this)"><option value="http://stackoverflow.com/questions/15723922/0"><--Select--> </option><?php $query=mysql_query("SELECT pname from expenses order by id");while($row=mysql_fetch_assoc($query)){$val2=$row['pname'];?><option value="http://stackoverflow.com/questions/15723922/<?=$val2;?>" <? if ($_GET['pname'] == $val2){ echo "selected='selected'"; }?> ><?=$row['pname'];?></option><?php }?></select></form>\[/code\]Url While Select \[code\]<option>Select</option>\[/code\]
searchexpense.php?pname=0Dynamically Option Select
searchexpense.php?pname=Test
searchexpense.php?pname=0Dynamically Option Select
searchexpense.php?pname=Test