473,372 Members | 859 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,372 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 1871
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.