Forum Moderators: coopster
<script language="javascript">
document.formHid.hid1[0].value="SONY";
document.formHid.hid1[1].value="PEPSI";
document.formHid.submit();
</script>
But when i print that array its characters are all separated like if i pass "SONY","PEPSI" from javascript, while printing in php it comes like S,O,N,Y,P,E,P,S,I.
i'm trying to print the submitted array in php like this,
<?
for($i=0;$i<2;$i++) print($hid1[$i]);
?>
i.e.
total = 0;
for (i = 0; i <= 1; i++)
{
total += this.form.hid1[i].value
}
This won't work with javascript because of the [] in the control name.