Javascript Problem: Safari 4.0 for Windows XP

Joined
Sep 4, 2009
Messages
1
Reaction score
0
Points
1
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>
 

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
NOTE: Moved to more appropriate forum.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top