Wednesday, 21 August 2013

i want to fill my field on click of combobox in for loop

i want to fill my field on click of combobox in for loop

sir i m trying to fill my field on click of combobox in for loop.I m
getting this but only in my one row.When i genrate another new row its is
not taking the value. i have more than one row to fill the field on click
of combo. i even try to use this with class but its is not happening. my
html code is
<td align="center"><input type="text" size="6" maxlength="6" maxlength="6"
id="code" name="code_0" class="code1 form-input-oth"/></td>
<script type="text/javascript">
function Expedisi(t)
{
var y = document.getElementById("code");
y.value = t.value;
}
</script>
when i do this with using for loop in javascript the code is
<script type="text/javascript">
function Expedisi(t)
{
var y;
for(var i=0; i<y.length;i++){
document.getElementById("code").innerHTML=y[i];
y[i].value = t.value;
}
}
</script>
but the above code is not working .. plz sir help me out

No comments:

Post a Comment