Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Submit Form and JavaScript

Status
Not open for further replies.

marinpa

Technical User
Feb 12, 2001
19
CA
Hello!

I would like to know what would be the best way to do this:

I have a form with three parts
1 - General Information about visitor
2 - Information about his business
3 - Detailes about his equipment

I would like to give the visitor the choice to fill and submit one, two or all three parts

I know there is a way to do it in JS but I do not know how.
Any help would be more than welcome. Thank you anticipated!

Here is the HTML code I have so far: (I believe the changes have to be made in the tags marked with red)
<html>
<body>

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td bgcolor="#FFE6DF">
<form name="form1" method="post" action="#nogo">
<input name="submitted" type="hidden" value="1">
<input name="submit_type" type="hidden" value="0">
<table width="800" border="0" cellspacing="0" cellpadding="0" height="96">
<tr>
<td width="800" align="left" valign="top" bgcolor="#FFFFCC" height="17">
<font size="5">
<b>First Part </b></font>(basic info)<br>
<input name="fname" type="text" id="fname" size="40" maxlength="50" value=""><br>
<input name="lname" type="text" id="lname" size="40" maxlength="50" value=""><br>
<input name="phone1" type="text" id="phone1" size="3" maxlength="3" value="">-
<input name="phone2" type="text" id="phone2" size="3" maxlength="3" value="">-
<input name="phone3" type="text" id="phone3" size="4" maxlength="4" value="">
<input name="pref" type="radio" checked value="phone" >preferred contact<br>
<input name="email" type="text" id="email" size="30" maxlength="50" value="">&nbsp;&nbsp;
<input name="pref" type="radio" value="email"> preferred contact<br>
<input name="submit1" type="submit" value="Submit Part 1" width="98" height="34" size="20"><br>or go to the next section </td></tr></table>
<table width="800" border="0" cellspacing="0" cellpadding="0" height="268">
<tr>
<td width="800" align="left" valign="middle" bgcolor="#E1FFE1" height="158">
<font size="5"><b>
Second Part</b></font>(detailed info)<br>
<input name="1" type="text" id="1" size="40" maxlength="50" value=""><br>
<input name="2" type="text" id="2" size="3" maxlength="3" value=""><br>
<input name="3" type="text" id="3" size="20" maxlength="40" value=""><br>
<input name="4" type="text" id="4" size="40" maxlength="50" value=""><br>
<input name="5" type="text" id="5" size="3" maxlength="3" value=""><br>
<input name="6" type="text" id="6" size="3" maxlength="3" value=""><br>
<input name="7" type="text" id="7" size="10" maxlength="20" value=""><br>
<input name="submit1&amp;2" type="submit" value="Submit Pat 1 &amp; 2" width="98" height="34" size="20"><br>or go to the next section</td></tr></table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" height="278">
<tr>
<td align="left" valign="top" height="164" width="800">
<font size="5"><b>Third part</b></font>(specific info)<br>
<input type="text" name="8" id="8" size="40" maxlength="50" value=""><br>
<input type="text" name="9" id="9" size="40" maxlength="50" value=""><br>
<input type="text" name="10" id="10" size="40" maxlength="50" value=""><br>
<input type="text" name="11" id="11" size="40" maxlength="50" value=""><br>
<input type="text" name="12" id="12" size="40" maxlength="50" value=""><br><label>
<input type="radio" name="13" value="Raw" checked> a</label><label>
<input type="radio" name="13" value="edited"> b</label><label>
<input type="radio" name="13" value="DVD"> c</label> <br><label>
<input type="radio" name="14" value="Yes" checked>Yes</label><label>
<input type="radio" name="14" value="No">No</label><label> <br>
<input type="text" name="15" id="15" size="40" maxlength="40" value=""><br></label><label>
<input type="radio" name="16" value="Yes" checked>Yes</label> <label>
<input type="radio" name="16" value="No">No<br></label>
<textarea name="additinfo" cols="75" rows="5" id="additinfo" size="20"></textarea><br>
<input type="submit" name="submitall" value="Submit All" width="98" height="34" size="20"></td></tr></table>
</form>



</table>


</body>
</html>
 
I don't understand what it is you are actually asking for here. The user has already got the choice to fill in one, two, or three parts of the form by simply filling in one, two, or three parts of the form, surely?

Why do you need code to enable them o do something they can simply choose to do or not do?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hey Dan,


Part 1
The user can submit only his contact information (Name, Phone number, Email), and his preffered contact method.

Part 2
Along with the contact information (from part 1), the user will send as well more detailed information about his request.

Part 3
Along with the information from part 1 and 2, the user will send additional/specific information, if he so chooses, in regards to the event preferred location, date, time, number of participants, etc.
 
I get the gist of how the form works - but you still haven't said what your problem is. What is it that you need help with?

Maybe I'm just not getting something really simple.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
The question is; how can I submit the form (part 1, part 1+2 or part 1+2+3)with the help of JavaScript, and/or JS and CGI.

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top