Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2004, 03:32 AM
Authorized User
 
Join Date: Nov 2003
Location: Phnom Penh, , Cambodia.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eapsokha
Default How to send form data without pressing SUBMIT

How can I insert data of a form into database without pressing the SUBMIT button, by clicking general button?

Many thanks

__________________
Mr. Sokha Eap
Webmaster
UNDP Cambodia
 
Old March 1st, 2004, 04:34 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What's wrong with clicking a Submit button?

Anyway, the only way to get the data from the client to the server is to use a form that submits to the server, whether it uses Post or Get doesn't really matter.

You can submit the form in a few ways. One you already know: the <input type="submit" />.
A second alternative is to use an image (<input type="image" src="bla.gif" />). When clicked, this image will perform the same as a submit button as it will submit the form to the server.

The third option is to use script. A general button (or any other HTML element) can fire JavaScript that submits the page to the server:

<input type="button" onclick="document.MyForm.submit();" value="Click Me" />

HtH,

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 1st, 2004, 09:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen N, , Denmark.
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

There is a forth way... Using an empty image you can send data with the src of the image.
<img src="bla.asp?hiddenData=<%= Request.ServerVariables("HTTP_REFERE") %>" width="1" height="1" />
In bla.asp you do all the processing. The data will be sent when the pages is loaded..

Regards - Jon




Similar Threads
Thread Thread Starter Forum Replies Last Post
Submit Form with QueryString Data Phil06 Javascript 4 June 15th, 2007 06:11 PM
Refresh Data when Submit Form ruso77 Infopath 0 April 13th, 2007 02:30 PM
submit data to db with html form....(help) PeterJB Beginning PHP 2 August 6th, 2006 12:07 AM
Submit repeated data item in a form using Struts somnathp Javascript How-To 0 July 26th, 2005 12:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.