LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-18-2004, 11:45 AM   #1
logicdisaster
Member
 
Registered: Jun 2004
Posts: 41

Rep: Reputation: 15
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>
 
Old 06-18-2004, 12:21 PM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
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.
 
Old 06-18-2004, 12:42 PM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
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.

Last edited by keefaz; 06-18-2004 at 12:43 PM.
 
Old 06-18-2004, 12:44 PM   #4
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
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.
 
Old 06-18-2004, 12:50 PM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
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)
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL results to html forms using PHP xemous Programming 3 08-15-2005 03:27 PM
Forms in HTML J_K9 Programming 5 06-30-2005 02:21 PM
passing an array from html-forms to php prabhatsoni Linux - Software 2 06-04-2005 12:11 AM
HTML Forms belorion Programming 1 02-01-2005 11:41 PM
HTML, PHP, forms, submitting data Problem Silent1 Programming 3 08-31-2004 03:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration