Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Individual and multiple 'batch' Form Posting using HTML?

Reply
Thread Tools

Individual and multiple 'batch' Form Posting using HTML?

 
 
Fernie
Guest
Posts: n/a
 
      12-25-2004
Dear friends,

I have 20 different forms on a single html page. Each form has its own text
input field and submit button to update text and a submit button to delete.

Each of the 20 forms consists of the following html:

<FORM method='POST' action='Products.cgi'>

// Display product details.

// Display a text Input Field.

// Display an submit 'update' button to post both
// input and hidden field data.

// Display a submit 'delete' button to post the
// record ID and delete the record.

</FORM>

When I click on the submit button belonging to any of the 20 forms on the
html page, the appropriate data is correctly posted to the server and either
a successful update or deletion is performed.



Now for the problem. All along, I had wrongly assumed that I could embed
all 20 forms within a single 'larger' form and perform a bulk update/delete
process. That large form would submit all of the smaller forms input and
hidden field data in one whack. After trying to figure it out, I sadly
discovered that this was not possible using html.

Ideally, I would like to handle this without relying on client side
scripting. Is there a way to accomplish this using plain html? If there is
not a way to do this, I am thinking that it may be best to assign each
item's delete button to a GET. Also, I'd have to get rid of the individual
update buttons and have a single form that updates the whole batch
regardless if one or two items were updated.

Any comments or suggestions would be much appreciated.

Regards,

Fernie



--

ELKNews FREE Edition - Empower your News Reader! http://www.atozedsoftware.com
 
Reply With Quote
 
 
 
 
Mitja
Guest
Posts: n/a
 
      12-26-2004
Fernie wrote:
> Dear friends,
>
> I have 20 different forms on a single html page. Each
> form has its own text input field and submit button to
> update text and a submit button to delete.
>
> Now for the problem. All along, I had wrongly assumed
> that I could embed all 20 forms within a single 'larger'
> form and perform a bulk update/delete process. That
> large form would submit all of the smaller forms input
> and hidden field data in one whack. After trying to
> figure it out, I sadly discovered that this was not
> possible using html.


Make it all _one_ big form with 21 buttons (submit1,
submit2, ..., submitAll). When the form is submitted, have
your server-side script check for the name of the button via
which the form was submitted. If the name is e.g. submit7,
only do the requested operations on product number 7; if the
name is submitAll, process all POST data.
The problem (probably) here are users submitting the page
with the ENTER key. There are guidelenes as to which
key-value pair browsers should submit, but they are not
implemented well enough to be relied upon. Google for html
form submit enter or something.

HTH,
Mitja


 
Reply With Quote
 
 
 
 
Fernie
Guest
Posts: n/a
 
      12-26-2004
"Mitja" <(E-Mail Removed)> wrote in message
news:Rzvzd.7414$(E-Mail Removed)...


> Make it all _one_ big form with 21 buttons (submit1,
> submit2, ..., submitAll).


Mitja,

Thank you very much for the excellent suggestion!

Best regards,

Fernie



--

ELKNews FREE Edition - Empower your News Reader! http://www.atozedsoftware.com
 
Reply With Quote
 
Fernie
Guest
Posts: n/a
 
      12-27-2004
Mitja,

I began looking at the form variables that are posted (via post) to the web
server and noticed something interesting with the buttons I use. I have a
button named btnSave. When clicked, I end up with an expected variable
named 'btnSave' and the value is 'Save Changes'.

In another instance, I post by clicking on a gif image (instead of a regular
button). Looking at the server variables, I get the mouse coordinates of
the button click. For example, I have an image button named 'btnUpdate'.
The form variables that are posted to the server are:

btnUpdate.x and the value is 40
btnUpdate.y and the value is 5

This means that I cannot specifically look for a variable named btnUpdate,
unless I trim off the '.x' or the '.y'. Then I get the variables that you
suggested that I look at (btnUpdate1, btnUpdate2, ...).


Regards,

Fernie



--

ELKNews FREE Edition - Empower your News Reader! http://www.atozedsoftware.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
posting to a form with no form name scripteaze@gmail.com Python 3 11-02-2007 08:29 AM
need javascript and form to play individual sounds on indiv. html pages - will pay cbell@interlog.com Javascript 0 07-16-2005 04:23 AM
accessing ado and MSDE on individual web form Spencer H. Prue ASP General 1 02-18-2005 11:07 AM
Posting form content to remote servers form? Rob Meade ASP .Net 0 12-01-2004 12:56 PM
WebClient form Posting with form name? Jeff Baker ASP .Net 2 08-29-2003 12:22 PM



Advertisments