PJP Posted February 13, 2005 Share Posted February 13, 2005 Hej! Följande kod fungerar alldeles utmärkt i IE, Opera men inte i FF. <% Response.Write("<form name=""t"" id=""t"" action=""ReceivingPage.aspx"" method=""post"">") For each Item in Session.Contents Response.Write "<input type=""hidden"" name='" & Item & "' value='" & Session.Contents(item) & "'>" Next Response.Write("</form>") Response.Write("<script language=""javascript"">t.submit();</script>") %> FF verkar inte reagera på t.submit(). Är det någon som har en aning hur man ska göra för att få ovanstående att fungera i FF? /PJ Link to comment Share on other sites More sharing options...
Loverman Posted February 22, 2005 Share Posted February 22, 2005 Prova att göra submit-javascriptet mer korrekt genom följande syntax: document.forms['t'].submit(); (har inte testat själv, men IE är rätt förlåtande om man gör sådana misstag, medans FF följer standarden) Link to comment Share on other sites More sharing options...
PJP Posted February 22, 2005 Author Share Posted February 22, 2005 Hej! Tack för svaret, men tyvärr så fungerar det fortfarande inte. Jag har även provat med... Response.Write("<form name=""t"" id=""t"" action=""welcome.aspx"" method=""post"" onload=""this.submit();"">") ... men det fungerar fortfarande inte. /PJ Link to comment Share on other sites More sharing options...
fhe Posted February 22, 2005 Share Posted February 22, 2005 Du får inte något fel i javascript-consolen som kan antyda vad som blir fel? Link to comment Share on other sites More sharing options...
PJP Posted February 22, 2005 Author Share Posted February 22, 2005 Jag var tvungen att lägga in allt mellan html och body taggar och sedan använda document.getElementById('t').submit(); för att få det att fungera. <html> <body> <% ' We graf all the session variable names/values and stick them in a form ' and then we submit the form to our receiving ASP.NET page (ASPNETPage1.aspx)... Response.Write("<form name=""t"" id=""t"" action=""ReceivingPage.aspx"" method=""post"">") For each Item in Session.Contents Response.Write("<input type=hidden name=" & Item) Response.Write( " value=" & Session.Contents(item) & " >") next Response.Write("</form>") Response.Write("<script>document.getElementById('t').submit();</script>") %> </body> </html> Poäng för att du fick mig på rätt spår. /PJ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.