Jump to content

Multiple forms, one submit button...how do i do this??


Recommended Posts

I'm looking for a way to have two (or more) separate forms, each sending different data to my mysql database but doing so by clicking only one single "Submit" button at the bottom of the page.

Elaboration:
I have a text field, two radio buttons and four checkboxes (which represent miscellaneous options) for each result of a search query. because of this, there is really no way i can tell how many results i will get back. I want the user to be able to enter text, click and unclick boxes and buttons for each result, and then apply all those changes by clicking ONE submit button at the bottom (or top) of the page.

I know this can be done, but i don't know if it requires javascripting. any help is greatly appreciated!

~kykin
i thought about doing it with one form as well, but as it turned out, i couldnt modify all the contents of all the results with just one button...i would have to do one by one, and that's not user-friendly.

let me use a real-world example:

when you upload pictures to flickr.com, you browse for local files, upload your pictures and then they are displayed for you in thumbnail form. you can then title your picture, add a description, and add tags for each picture you uploaded as they are all displayed on one single page. then at the bottom of the page, you click the single big "SAVE" button, and all the data is passed along with its corresponding picture.

i want to do something like that, but not with pictures, but search results. multiple forms, each corresponding to its own result, but one big "SUBMIT" button at the bottom.
Now take another look at it, using Opera browser. Look at the source code. It may not show any serverside code but you can still see that it is one big form. I seriously dont think it is possible to take data from another form on submit.

RC
I think for what you are talking about you'll need to use ajax.

You're saying after the user enters some data, more information will appear which they can then edit, and THEN submit? Try mootools.net's ajax features.
*sigh* AJAX.....why....ajax hates me.

anyways, i didn't think that it was possible to submit multiple forms with just one button...but i suppose with a bit of java magic i could give it a try... perhaps i'll poke around the ajax board a bit before i move on to the mootools site. this ajax thing is rather intimidating to me..

thanks for your help. i'm at least pointed in the right direction now.

KK
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.