Jump to content


Photo

first load js and form


  • Please log in to reply
4 replies to this topic

#1 yosii

yosii

    Advanced Member

  • Members
  • PipPipPip
  • 37 posts

Posted 24 February 2013 - 07:23 AM

<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

#2 Love2c0de

Love2c0de

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • LocationThe Pleiades
  • Age:23

Posted 24 February 2013 - 03:08 PM

So you want to show only 1 form and make the first form auto send?

Regards,

L2c.

#3 yosii

yosii

    Advanced Member

  • Members
  • PipPipPip
  • 37 posts

Posted 24 February 2013 - 05:39 PM

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

#4 cyberRobot

cyberRobot

    Advanced Member

  • Gurus
  • 1,575 posts

Posted 25 February 2013 - 08:59 AM

You could try something like this:

<script type="text/javascript">
window.onload = function() {
     document.getElementById('a1').submit();
}
</script>

Blogging about PHP and other web development topics at ScorpBytes.com

#5 Love2c0de

Love2c0de

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • LocationThe Pleiades
  • Age:23

Posted 25 February 2013 - 04:41 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com