57
rated 0 times
[
58]
[
1]
/ answers: 1 / hits: 59733
/ 12 Years ago, thu, april 12, 2012, 12:00:00
I am using a selectbox to display the list of enterpirses from the database. But the onchange event is not triggering. But when i manually once put the value of querystring then it starts working. I dont understand why it is happening.
I am new to javascript and php, kindly suggest me the solution to this.
<select id=enterprisebox onchange=javascript:valueselect() >
<option value=->-</option>
<?php foreach($enterprise as $val) { ?>
<option value=<?php echo $val['customer_id'];?>><?php echo $val['customer_name']?>
</option>
<? } ?>
</select>
and my javascript is--
function valueselect()
{
var i = document.getElementById('enterprisebox');
var p = i.options[i.selectedIndex].value;
//alert(p);
window.location.href = channelinformation.html?selected=+p;
}
More From » php