LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Breaking up html forms (https://www.linuxquestions.org/questions/programming-9/breaking-up-html-forms-195018/)

logicdisaster 06-18-2004 11:45 AM

Breaking up html forms
 
I need to figure out a way to break up a single form into multiple parts on a single page. The reason being is i have two forms. I need to have the first half of form one on the top of the page then form 2 in the middle and then the last half of form one on the bottom. is there a way to link the first and second half of a form?

quick example:

<form1>
<input1>
</form1>

<form2>
<input2>
<submit2>
</form2>

<form1>
<submit1>
</form1>

Donboy 06-18-2004 12:21 PM

I don't think so. But it sounds like all you're trying to do is put both of the submit buttons at the bottom so the user can submit form1 or 2 by using one of the buttons at the bottom.

Either way, the only solution I can think of is make everything into one big form. You can give names to your submit buttons, so if the user clicks submit button 1, the script will only process the first group of stuff... if they use submit button 2, the script will process only the second group of stuff.

keefaz 06-18-2004 12:42 PM

or for the last button you can use javascript :
<input type="button" value="click here to submit form1" onClick="document.form1.submit();">

You can put that code anywhere in your html file, it does not matter.

Donboy 06-18-2004 12:44 PM

You know... I thought of that, and I was very close to putting that into my post... but I didn't want to advise him to use somethign that depends on the person having JS enabled. If they don't have it enabled, there won't be any clue to the user why their form won't submit.

keefaz 06-18-2004 12:50 PM

Maybe put a message in the site to advise users about that...Anyway I agree with you for my part I would choose your solution ;) (one HTML form for all)


All times are GMT -5. The time now is 06:43 AM.