I’ve been struggling to figure this out on my own for hours. I hope someone here can assist me with this problem. I am using a javascript function to pass variables to fields within a form and then to submit that form. Of course, it works fine in Firefox, but the values don’t seem to post to the other script in IE. Can anyone tell me if there is an obvious reason why this isn’t working with IE?
[B]I have a JS function as follows:
function dosubmit (action, roomid, floorid, complexid)
{
field = document.getElementById(‘action’);
if(action == 1){
field.value = ‘cancel’;
}else{
field.value = ‘select’;
}
field = document.getElementById(‘roomid’);
field.value = roomid;
field = document.getElementById(‘floor’);
field.value = floorid;
field = document.getElementById(‘complex’);
field.value = complexid;
form = document.getElementById(‘mainform’);
form.submit();
}
[B]That much is pretty straight forward, I hope. Here is the stuff in the body:
<form action=”../select_room.php” id=”mainform” method=”post”>
<?php
echo “<input name=’go’ type=’button’ onClick=’dosubmit($action, $roomid, $floorid, $complexid);’ value=’reserve’>”;
?>
<input name=”complex” id=”complex” type=”hidden” value=”” />
<input name=”floor” id=”floor” type=”hidden” value=”” />
<input name=”action” id=”action”type=”hidden” value=”” />
<input name=”roomid” id=”roomid” type=”hidden” value=”” />
</form>
THanks!!