473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Submitting a form without user intervention

Don
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is
there some way, using JavaScript, to setup a <form> tag to do this?

Thanks,
Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 23 '05 #1
5 1875
Ivo
"Don" <no@adr.com> asks
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this?

Thanks,
Don

The question is of course what way the user (or some 'background process')
should submit your form in your alternative scenario. Onload of the window?
Onkeypress anywhere? Anyhow you are probably going to use the notorious
submit() method in some form or other. Like so:

<script type="text/javascript">
document.forms[0].submit();
</scipt>

Submitting a form destroys the existing page and loads a new one from the
server. It is impossible to submit multiple forms or perform any action
after submit() has been called.
Depending on the contents of the form elements, some confirmation dialog
browser windows may be unavoidable before the final Submission.

HTH
--
Ivo
http://www.vansandick.com/
Jul 23 '05 #2
Don
On Wed, 1 Dec 2004 07:11:06 +0100, "Ivo" <no@thank.you> wrote:
"Don" <no@adr.com> asks
I have a need to submit a form, but don't need the user to click on a

button. How do I do this? Is
there some way, using JavaScript, to setup a <form> tag to do this?

Thanks,
Don

The question is of course what way the user (or some 'background process')
should submit your form in your alternative scenario. Onload of the window?
Onkeypress anywhere? Anyhow you are probably going to use the notorious
submit() method in some form or other. Like so:

<script type="text/javascript">
document.forms[0].submit();
</scipt>

Submitting a form destroys the existing page and loads a new one from the
server. It is impossible to submit multiple forms or perform any action
after submit() has been called.
Depending on the contents of the form elements, some confirmation dialog
browser windows may be unavoidable before the final Submission.

HTH

I'm not sure I follow you here. I don't want any user intervention. Yet, I want to submit the
<form> to the server PHP script. The script that submit's the <form> will be doing some data
manipulation, but there's no need for the user to have to click on anything. When the data
manipulation is done I want a <form> to be submitted to another server-side PHP script.

Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 23 '05 #3
"Don" <no@adr.com> wrote in message
news:mg********************************@4ax.com...
On Wed, 1 Dec 2004 07:11:06 +0100, "Ivo" <no@thank.you> wrote:
"Don" <no@adr.com> asks
I have a need to submit a form, but don't need the user to click on abutton. How do I do this? Is
there some way, using JavaScript, to setup a <form> tag to do this?

Thanks,
Don

The question is of course what way the user (or some 'background process')should submit your form in your alternative scenario. Onload of the window?Onkeypress anywhere? Anyhow you are probably going to use the notorious
submit() method in some form or other. Like so:

<script type="text/javascript">
document.forms[0].submit();
</scipt>

Submitting a form destroys the existing page and loads a new one from the
server. It is impossible to submit multiple forms or perform any action
after submit() has been called.
Depending on the contents of the form elements, some confirmation dialog
browser windows may be unavoidable before the final Submission.

HTH

I'm not sure I follow you here. I don't want any user intervention. Yet,

I want to submit the <form> to the server PHP script. The script that submit's the <form> will be doing some data manipulation, but there's no need for the user to have to click on anything. When the data manipulation is done I want a <form> to be submitted to another server-side PHP script.
Don


As Ivo explains this is easy enough to do but there are things you should
consider in addition to his remarks.
When the form is submitted the clients page WILL be refreshed!!! Even if
you put everything back this could be very annoying! Especially since the
user will not be expecting it.

I suggest you post some code and explain what you are doing; tracking user
actions, tracking internal link usage, or just validating form data and
submitting when you have enough info or whatever. Be more specific and you'l
l be pointed in the right direction.
Jimbo
Jul 23 '05 #4
Don
On Wed, 1 Dec 2004 09:22:49 +0200, "J. J. Cale" <ph****@netvision.net.il> wrote:
"Don" <no@adr.com> wrote in message
news:mg********************************@4ax.com.. .
On Wed, 1 Dec 2004 07:11:06 +0100, "Ivo" <no@thank.you> wrote:
>"Don" <no@adr.com> asks
>> I have a need to submit a form, but don't need the user to click on a
>button. How do I do this? Is
>> there some way, using JavaScript, to setup a <form> tag to do this?
>>
>> Thanks,
>> Don
>>
>The question is of course what way the user (or some 'backgroundprocess') >should submit your form in your alternative scenario. Onload of thewindow? >Onkeypress anywhere? Anyhow you are probably going to use the notorious
>submit() method in some form or other. Like so:
>
><script type="text/javascript">
> document.forms[0].submit();
></scipt>
>
>Submitting a form destroys the existing page and loads a new one from the
>server. It is impossible to submit multiple forms or perform any action
>after submit() has been called.
>Depending on the contents of the form elements, some confirmation dialog
>browser windows may be unavoidable before the final Submission.
>
>HTH

I'm not sure I follow you here. I don't want any user intervention. Yet,

I want to submit the
<form> to the server PHP script. The script that submit's the <form> will

be doing some data
manipulation, but there's no need for the user to have to click on

anything. When the data
manipulation is done I want a <form> to be submitted to another

server-side PHP script.

Don


As Ivo explains this is easy enough to do but there are things you should
consider in addition to his remarks.
When the form is submitted the clients page WILL be refreshed!!! Even if
you put everything back this could be very annoying! Especially since the
user will not be expecting it.

I suggest you post some code and explain what you are doing; tracking user
actions, tracking internal link usage, or just validating form data and
submitting when you have enough info or whatever. Be more specific and you'l
l be pointed in the right direction.
Jimbo

I have a erver-side PHP script that processes possible upload files, and also prepares some <input>
tags from data sent by the client-side page that invoked this PHP script. If there were any
uploaded files I print a message indicating the upload was successful, and I want the user to have
time to read the message. Therefore, I want him to click on a "continue" button. However, if there
were no uploads, I still want to do some <input> tag preparation from data sent by the invoking
page, but don't need to display anything, and don't need the user to click on a button. In either
case, the <form> tag has the same "action" element. Just want a button in one case, and not in the
other. How do I go about this?

Thanks for your help, both of you guys.
Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 23 '05 #5
Don
On Wed, 1 Dec 2004 07:11:06 +0100, "Ivo" <no@thank.you> wrote:
"Don" <no@adr.com> asks
I have a need to submit a form, but don't need the user to click on a

button. How do I do this? Is
there some way, using JavaScript, to setup a <form> tag to do this?

Thanks,
Don

The question is of course what way the user (or some 'background process')
should submit your form in your alternative scenario. Onload of the window?
Onkeypress anywhere? Anyhow you are probably going to use the notorious
submit() method in some form or other. Like so:

<script type="text/javascript">
document.forms[0].submit();
</scipt>

Submitting a form destroys the existing page and loads a new one from the
server. It is impossible to submit multiple forms or perform any action
after submit() has been called.
Depending on the contents of the form elements, some confirmation dialog
browser windows may be unavoidable before the final Submission.

HTH

Got it working just great. Thanks for your help Ivo.
Don
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bjorn | last post by:
Hi, I need to submit in the same page two forms to two different ASP-pages. I created two forms, each with hidden input and a submit button. But it doesn't work. Nothing happens with the second...
3
by: Sara | last post by:
Hi all, I don't know if this is possible or if it even makes sense, but this is what I want to do. I have a page with a form to fill in a timesheet for a user. Depending on how many users did a...
2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
14
by: threeflush | last post by:
I'm supporting an ASP legacy application and need to implement "autosave" functionality. I have two frames, one that holds tabs displaying different pages a user can select, and the other that...
4
by: Tauqir | last post by:
Hi, Is there a trick for submitting an HTML form without action parameter pointing to the target file? I am trying to reverse engineer an html form inside a jsp page. and this is what I come...
3
by: Andy | last post by:
Hi, New to Access... so please be kind. Have designed a form which ithe user may wish to update the data in future (name/address/tel info) I would like to put a button on the page so the user...
4
by: Nacho Nachev | last post by:
This may sound like a silly question, but what is the appropriate way to handle form double submitting in ASP.NET. Page expiration, etc? I am looking for a way to handle this in some cetral point...
4
by: Ashok | last post by:
Dear Friends, How to download a file from server to client local pc without user intervention ie without the save as popup window. Can you give me step by step. Thanks
3
by: klikic | last post by:
Hi. My problem: I need to send to the client page with some text and after a few seconds the page form has to be submitted without client intervention. I played with JavaScript "setTimeout()" and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.