By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

On Load Submit is not working in FF ?

Soniad
P: 66
Hi,

I have ASP page,Say "page1.asp" .
Ater filling proper information,when "page1.asp" is submitted ;it goes to "page2.asp".
On This "page2.asp",only VBScript Coding is done (DB Related).
Now,On "Page2.asp" after VBScript coding is done ,I have taken a message into hidden field (that needs to be displayed on "Page1.asp") And written script at the End of the page to submit that page back to "Page1.asp".
Now the problem is,This works in IE .In IE,the page is submitted back to "Page1.asp", But Doesn't work in FireFox.
In FireFox, The VBScript Code is getting Executed;But Stops there only after exceution is done.
If I write only 'response.Redirect("Page1.asp")' OR 'window.location.href="Page1.asp"'.This works in BOTH.
But I want to show that message in "Page1.asp",Hence I am posting back that "Page2.asp".

I dont want to send that message as QueryString.


Page2.asp Sample :

Expand|Select|Wrap|Line Numbers
  1. <% Dim StrDispMsg
  2.  
  3.  'CODE
  4.  
  5.  StrDispMsg = "Test Message"
  6. %>
  7. <form name="FrmPage2" method="post"><input type="hidden" name="HidMessage" value="<%=StrDispMsg%>" />
  8. <script type="text/javascript">
  9. FrmPage2.action = "Page1.asp";
  10. FrmPage2.method = "post";
  11. FrmPage2.submit();
  12. </script>
  13. </form>
  14.  
Any Suggesstion.

Regards,

"D"
Mar 28 '11 #1
Share this Question
Share on Google+
1 Reply


Soniad
P: 66
Hi,

Finally after a long try, this issue has been solved.
Instead of using Hidden field ,If I put that message in input filed of type "Text" it works. Both in IE And FF.
Instead Of This line :
Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="HidMessage" value="<%=StrDispMsg%>" />
  2.  
I Wrote This Line:
Expand|Select|Wrap|Line Numbers
  1. <input type="Text" name="HidMessage" value="<%=StrDispMsg%>" style="display:none;"/>
  2.  
Final Code :
Expand|Select|Wrap|Line Numbers
  1. <% Dim StrDispMsg 
  2.  
  3.  'CODE 
  4.  
  5.  StrDispMsg = "Test Message" 
  6. %> 
  7. <form name="FrmPage2" method="post">
  8. <input type="Text" name="HidMessage" value="<%=StrDispMsg%>" style="display:none;"/> 
  9. <script type="text/javascript"> 
  10. FrmPage2.action = "Page1.asp"; 
  11. FrmPage2.method = "post"; 
  12. FrmPage2.submit(); 
  13. </script> 
  14. </form> 
  15.  
Regards,
"D"
Apr 6 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.