I’m making a javascript function on blank application,
the script is
<script type=“text/javascript”>
window.onload = fillDropDown();
?>
function fillDropDown() {
var ddl = document.getElementById( ‘myDropdown’ );
var theOption = new Option;
var x;
var i;
for(i = 0; i < 999; i++) {
x = i + 1;
theOption.text = x;
theOption.value = x;
ddl.options[i] = theOption;
}
}
</script>
<form id=“myForm”>
<select id=“myDropdown”></select>
</form>
<?php
but when run the application i get the message:
undefined global variable:i
so why happen this and what i can do?
i need make this application.
thanks in advance