473,722 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1910
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.c om...
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****@netvisi on.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
4541
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 form. Does it exist a way to do that? Thanks bjorn
3
1338
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 "job", a form will appear on the page for each user. So basically, you could have 3 forms, all with the same names etc. and the only thing distinguishing them is a hidden input with userID and different data for each user. Now what I want the person...
2
2220
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 hitting of the enter key was to simply not have a submit button, instead going for a regular anchor which calls a javascript confirmation box and then submits the form.
14
6902
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 holds the page content itself. If a user clicks on another tab without clicking the Submit button, I want to submit the current form for them and do some further processing. The problem is that top.framename.formname.submit() only works...
4
11414
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 across <form method="POST" name="Userpasshidden" onsubmit='return true'><!-- action="../../login.jsp" --> .....
3
1418
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 can update the "edit date" if they wish. How can I do this so that hitting a button updates the "edit date" with the current date?
4
1672
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 of the application without affecting the web page implementation. Thanks, Nacho
4
2931
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
1373
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 "while" methods but with no luck. Any suggestions are welcome. Thanks. Alan
0
8863
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9384
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9238
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9088
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.