katasova
12-12-2005, 11:22 AM
hi evreyone, i want to call a funtion to populate a combo box, but it is not working, this is my code
<form name="form1" action="" method="post">
<select name="state" id="estado" onchange="javascript:change();">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<select name="city">
<option value="#">place holder</option>
</select>
<?php
include "Includes/ListCitys.php";
?>
<script language="javascript" type="text/javascript">
function change(){
var cacheobj=document.form1.city;
populate(combo1);
}
</script>
Evreything works fine if i dont try to use a function i.e.
<script language="javascript" type="text/javascript">
var cacheobj=document.form1.city;
populate(combo1);
</script>
but it is like the onChange property of my first combo box is not really calling the the function was never called...
anyone have any idea on why is this happening?
THX
<form name="form1" action="" method="post">
<select name="state" id="estado" onchange="javascript:change();">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<select name="city">
<option value="#">place holder</option>
</select>
<?php
include "Includes/ListCitys.php";
?>
<script language="javascript" type="text/javascript">
function change(){
var cacheobj=document.form1.city;
populate(combo1);
}
</script>
Evreything works fine if i dont try to use a function i.e.
<script language="javascript" type="text/javascript">
var cacheobj=document.form1.city;
populate(combo1);
</script>
but it is like the onChange property of my first combo box is not really calling the the function was never called...
anyone have any idea on why is this happening?
THX