Automatic postback for a form?

F

Fred Geurtsen

Hi,

My question is how I can send a form without having to push on a submit
button? I need to send a form with method post just by loading the hidden
textboxes and send them right away. Anyone got the anser?

Thx
 
E

Evertjan.

Fred Geurtsen wrote on 15 dec 2004 in comp.lang.javascript:
My question is how I can send a form without having to push on a
submit button? I need to send a form with method post just by loading
the hidden textboxes and send them right away. Anyone got the anser?

document.forms.myForm.submit()

Dat had je ook wel op kunnen zoeken!
 
G

Grant Wagner

Fred Geurtsen said:
Hi,

My question is how I can send a form without having to push on a submit
button? I need to send a form with method post just by loading the hidden
textboxes and send them right away. Anyone got the anser?

<head>
<script type="text/javascript">
window.onload = function() {
document.forms['myForm'].submit();
}
</script>
</head>
<body>
<form name="myForm">

or

<body onload="document.forms['myForm'].submit();">
<form name="myForm">

Most user agents will present the user with a prompt asking them if they
really want to submit the form. No, there is no way to get around that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top