yosii Posted February 24, 2013 Share Posted February 24, 2013 <html> <head> </head> <body> BLA BLA BLA BLA BLA BLA BLA BLA V BLA BLA <img src='a.gif' /> <img src='e.gif' /> <img src='vv.gif' /> <img src='ff.gif' /> <form id="a1" action="5.php" method="post" > <INPUT TYPE="hidden" value="111111" NAME="name" > <INPUT TYPE="hidden" value="22222" NAME="add" > </form> <script> document.getElementById('a1').submit() </script> BLA BLA BLA BLA BLA BLA BLA BLA V BLA BLA <img src='f.gif' /> <img src='1.gif' /> <img src='3.gif' /> <img src='6.gif' /> BLA BLA BLA BLA BLA BLA BLA BLA V BLA BLA <form id="a2" action="5.php" method="post" > <INPUT TYPE="hidden" value="xxx1" NAME="name" > <INPUT TYPE="hidden" value="22222" NAME="add" > </form> </body> </html> ass you see there is lot of image text and forms there is function in js that make the form(a1) that it auto send .... hoe can i do that the form +js function load first and all of the images and txt the the another forms not be load how? thank Quote Link to comment https://forums.phpfreaks.com/topic/274882-first-load-js-and-form/ Share on other sites More sharing options...
Love2c0de Posted February 24, 2013 Share Posted February 24, 2013 So you want to show only 1 form and make the first form auto send? Regards, L2c. Quote Link to comment https://forums.phpfreaks.com/topic/274882-first-load-js-and-form/#findComment-1414702 Share on other sites More sharing options...
yosii Posted February 24, 2013 Author Share Posted February 24, 2013 So you want to show only 1 form and make the first form auto send? Regards, L2c. i want that only 1 from will show and it will auto send Quote Link to comment https://forums.phpfreaks.com/topic/274882-first-load-js-and-form/#findComment-1414733 Share on other sites More sharing options...
cyberRobot Posted February 25, 2013 Share Posted February 25, 2013 You could try something like this: <script type="text/javascript"> window.onload = function() { document.getElementById('a1').submit(); } </script> Quote Link to comment https://forums.phpfreaks.com/topic/274882-first-load-js-and-form/#findComment-1414809 Share on other sites More sharing options...
Love2c0de Posted February 25, 2013 Share Posted February 25, 2013 Yup cyberRobot I think has got your problem spot on. I just read your first post again and I think that's what you will want. Not sure why you have 2 forms, with the 2nd only containing hidden fields? You could just put your hidden fields within your a1 form so that you can retrieve the values on a server-side script(if that was the plan). I don't think you will be able to retrieve those hidden values from your a2 form. Kind regards, L2c. Quote Link to comment https://forums.phpfreaks.com/topic/274882-first-load-js-and-form/#findComment-1414916 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.