Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Mac IE form problem


Message #1 by "Tom Murphy" <tom@i...> on Thu, 9 Aug 2001 17:05:04
Hi,

The client Javascript dynamically collects data and posts it using <input 
type=hidden...> to an ASP page.  Apparently, any hidden fields within a 
<div> on a Mac are not updated or are ignored??  Any recommendations for a 
work around would be greatly appreciated.

The attached program demonstrates the problem.

Using a Win2k IE Client, I get the expected results:

Form Elements Posted to this page:
Element A has a value of A
Element B has a value of B
Element C has a value of C

When I use a Mac IE 5.0 Client I get this:

Form Elements Posted to this page:
Element A has a value of A
Element C has a value of C


Notice, no "B" element on the Mac. To experience this first hand, save 
this file on IIS or PWS as AR_Test.asp:

'''''''BEGIN FILE

<%

' Display the form variables that were posted to this page.
If Request.Form.Count > 0 Then
	Response.Write "<b>Form Elements Posted to this page:<br></b>"
	dim obj
	for each obj In Request.Form()
	   Response.Write "Element " & obj & " has a value of " & 
Request.Form(obj) & "<br>"
	next
End If

%>

<head>

<script language=javascript>

function AddHidden()
{
 D1.innerHTML = "<input type=hidden name=B value=B>";
 return true;
}

</script>
</head>
<body>

 <form id="AR" action="AR_Test.asp" method="POST" onsubmit="AddHidden()">
  <input type="hidden" name="A" value="A">
  <div id="D1"></div>
  <input type="hidden" name="C" value="C">
  <input type="submit" name="save" value="Submit">
 </form>

</body>
</html>

  Return to Index