I was testing some scripts across major browsers. It was going on well till I tested on Safari 4.0 for Windows XP.
I wanted to put some values in the hidden field before the form is submitted.
When the form is submitted the value of the submit button doesn't seem to be set by the the browser(Safari 4.0). The URL after submit doesn't show the name of the submit button.
Would be very glad if anyone can show some pointers or explain why Safari is behaving this way.
Thank you.
<?
//----------
// test.php
//----------
echo '********************************************';
echo "<br>fname = ". $_REQUEST['fname'];
echo "<br>submitaction = ". $_REQUEST['submitaction'] . '<br>';
echo '********************************************<br>';
?>
<html>
<head>
<script type="text/javascript">
<!--
function forward()
{
var x = document.getElementById("fconfirm");
// do something;
x.submit();
}
-->
</script>
</head>
<body>
<form id = "fconfirm" action = "test.php" method="get">
FirstName:<input type = "text" name ="fname">
<!-- some hidden fields -->
<input type = "submit" id = "submitaction" name = "submitaction" value = "Submit" onclick = "javascript: forward();">
</form>
</body>
</html>
I wanted to put some values in the hidden field before the form is submitted.
When the form is submitted the value of the submit button doesn't seem to be set by the the browser(Safari 4.0). The URL after submit doesn't show the name of the submit button.
Would be very glad if anyone can show some pointers or explain why Safari is behaving this way.
Thank you.
<?
//----------
// test.php
//----------
echo '********************************************';
echo "<br>fname = ". $_REQUEST['fname'];
echo "<br>submitaction = ". $_REQUEST['submitaction'] . '<br>';
echo '********************************************<br>';
?>
<html>
<head>
<script type="text/javascript">
<!--
function forward()
{
var x = document.getElementById("fconfirm");
// do something;
x.submit();
}
-->
</script>
</head>
<body>
<form id = "fconfirm" action = "test.php" method="get">
FirstName:<input type = "text" name ="fname">
<!-- some hidden fields -->
<input type = "submit" id = "submitaction" name = "submitaction" value = "Submit" onclick = "javascript: forward();">
</form>
</body>
</html>