URGENT: Function to Submit 2 Forms on Same Page to ASP

champ_010
champ_010 used Ask the Experts™
on
Back on the Javascript side with this form...

Here is a  form where the first three choices made by the user from radio buttons and drop-down menus, makes another form appear below using JavaScript.

The form above obviously doesn't need to be validated (just need to retrieve values later) but the hidden form that appears below, needs the text fields validated as well as demand that drop-down menus where available be used to indicate birthdate.

I would like to validate the form in ASP, but would like the main form and the choosen hidden form to both go to the ASP page when the Submit button of the choosen form is pressed. (All hidden forms have their own Submit button).  I plan to retrieve information from both forms to send via ASP email once fields in the hidden form have been validated in the same ASP page.  also ASP instead of Javascript because I want error messages posted to a new HTML page.

that's just background info...

in short, I need a function that can be applied to each hidden form/Submit button, and depending on which one is pressed, (only one hidden form appears in each case) to submit itself and the main form above to the same ASP page.

Is this possible--if so, can you please insert the function in the script below, cut, paste etc.  

Thank you in advance for helping.




<script>
<!--

var temp, temp1;
var group, groups;
var inquiries, questions;

formList=new Array("showForm2","showForm1","showForm3");

function buildArrays(){

groups = document.all("custType").length + 1 //+ 1 if for the drop down item select...

group=new Array(groups)

for (i=0; i<groups; i++) group[i]=new Array();

group[0][0]=new Option("---Please Select A Customer Type Above---"," ");

group[1][0]=new Option("---Please Select A Product Type----"," ");
group[1][1]=new Option("Bakery","47");
group[1][2]=new Option("Deli ","46");
group[1][3]=new Option("Meat","45");

group[2][0]=new Option("--Please Select A Product Type---"," ");
group[2][1]=new Option("Vegtables ","115");
group[2][2]=new Option("Frozen Dinners ","116");
group[2][3]=new Option("Dairy Products ","45");

group[3][0]=new Option("--Please Select A Product Type---"," ");
group[3][1]=new Option("Cosmetics","115");
group[3][2]=new Option("Dental","116");
group[3][3]=new Option("Bandages","45");


temp=document.contactForm.productCat;

questions=temp.options.length
inquiries=new Array(groups)
for (i=0; i<groups; i++)  {
    inquiries[i]=new Array(group[i].length);
    for (j=0; j<group[i].length; j++)  {
         inquiries[i][j]=new Array()  
    }
}

inquiries[0][0][0]=new Option("---Select---"," ");
inquiries[1][0][0]=new Option("---Please Select From the Menu Above---");
inquiries[1][1][0]=new Option("Please Select An Inquiry Type");
inquiries[1][1][1]=new Option("bakeryInq1","showForm1") ; // *
inquiries[1][1][2]=new Option("bakeryInq2","nonshowForm1");
inquiries[1][1][3]=new Option("bakery","showForm3");

inquiries[1][2][0]=new Option("Please Select An Inquiry Type");
inquiries[1][2][1]=new Option("deliInq1","showForm1");
inquiries[1][2][2]=new Option("deliInq2","showForm2");
inquiries[1][2][3]=new Option("deliInq3","showForm3");

inquiries[1][3][0]=new Option("Please Select An Inquiry Type");
inquiries[1][3][1]=new Option("meatInq1","showForm1");
inquiries[1][3][2]=new Option("meatInq2","showForm2");
inquiries[1][3][3]=new Option("meatInq3","showForm3");
inquiries[1][3][4]=new Option("meatInq4","showForm2");
inquiries[1][3][5]=new Option("meatInq5","showForm3");

inquiries[2][0][0]=new Option("---Please From the Menu Above---");
inquiries[2][1][0]=new Option("Please Select An Inquiry Type");
inquiries[2][1][1]=new Option("veggiesInq1","showForm1");
inquiries[2][1][2]=new Option("veggiesInq2","showForm2");
inquiries[2][1][3]=new Option("veggiesInq3","showForm3");

inquiries[2][2][0]=new Option("Please Select An Inquiry Type");
inquiries[2][2][1]=new Option("frozen1","showForm1"); //*
inquiries[2][2][2]=new Option("frozen2","showForm2");
inquiries[2][2][3]=new Option("frozen3","showForm3");

inquiries[2][3][0]=new Option("Please Select An Inquiry Type"," ");
inquiries[2][3][1]=new Option("dairyInq1","showForm1");
inquiries[2][3][2]=new Option("dairyInq2","showForm2");
inquiries[2][3][3]=new Option("dairyInq3","showForm3");

inquiries[3][0][0]=new Option("---Please Select From the Menu Above---");
inquiries[3][1][0]=new Option("Please Select An Inquiry Type");
inquiries[3][1][1]=new Option("cosmeticsInq","showForm1");
inquiries[3][1][2]=new Option("cosmeticsInq2","showForm2");
inquiries[3][1][3]=new Option("cosmeticsInq3","showForm3");
inquiries[3][1][4]=new Option("cosmetictsInq4","showForm3");
inquiries[3][1][5]=new Option("cosmetictsInq5","showForm1");

inquiries[3][2][0]=new Option("Please Select An Inquiry Type");
inquiries[3][2][1]=new Option("dentalInq1","showForm1");
inquiries[3][2][2]=new Option("dentalInq2","showForm2");
inquiries[3][2][3]=new Option("dentalInq3","showForm3");
inquiries[3][2][4]=new Option("dentalInq4","showForm1");
inquiries[3][2][5]=new Option("dentalInq5","showForm3");

inquiries[3][3][0]=new Option("Please Select An Inquiry Type","showForm1");
inquiries[3][3][1]=new Option("firstAid1","showForm1");
inquiries[3][3][2]=new Option("firstAid2","showForm2");
inquiries[3][3][3]=new Option("firstAid3","showForm3");
inquiries[3][3][4]=new Option("firtsAid4","showForm1");
inquiries[3][3][5]=new Option("firstAid5","showForm3");

temp1=document.contactForm.inquiryType;

}

function nextGroup(x){

for (m=temp.options.length-1;m>0;m--) temp.options[m]=null;
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}

temp.options[0].selected=true;
nextGroup1(0);

}

function nextGroup1(y){

displayForm('');

var selRadio;

for (m=temp1.options.length-1;m>0;m--) temp1.options[m]=null;
for (i=0;i<inquiries[document.all("custType").length][y].length;i++)
{
    for(k=0;k<document.all("custType").length;k++) {
         if (document.contactForm.custType[k].checked == true) selRadio = k;          
    }
    temp1.options[i]=new
   

Option(inquiries[document.contactForm.custType[selRadio].value][y][i].text,inquiries[document.contactForm.custType

[selRadio].value][y][i].value);
}
temp1.options[0].selected=true

}

function nextGroup2(z){

displayForm(z.options[z.selectedIndex].value);

}

var appearFields = "";

function displayForm(formName){

for (var i=0;i<formList.length;i++) {
     if (formName!=formList[i]) { eval('document.'+formList[i]).style.display='none'; }
}

if (formName=='') { return false; }

var thisForm=eval('document.'+formName);

thisForm.style.display='inline';

}      

//-->
</script>

<html>
<head>
<title>Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onload="buildArrays();">

<form name="contactForm">
<table border="0" cellspacing="0" cellpadding="0">
<tr align="left">
<td nowrap height="11"> &nbsp;
<p>
<input name="custType" type="radio" value=1 onclick="nextGroup(this.value)">Delivery Truck1 <br>
<input name="custType" type="radio" value=2 onclick="nextGroup(this.value)">Delivery Truck 2<br>
<input name="custType" type="radio" value=3 onclick="nextGroup(this.value)">Delivery Truck 3<br>

</p>
<p>
<select name="productCat" size="1" onChange="nextGroup1(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Please Select A Customer Type Above--------------</option>
<option value=" " selected>---Please Select A Customer Type Above--------------</option>
</select>
</p>
<p>
<select name="inquiryType" size="1" onChange="nextGroup2(this)">
<option value=" " selected> </option>
<option value=" " selected>---Please Select A Customer Type Above----------------</option>
<option value=" " selected>---Please Select A Customer Type Above----------------</option>
</select>
</p>
</td>
</tr>

</table>
</form>

<form name="showForm2"  style="display:none;">

      First Name: <input type="text" name="firstName">&nbsp;&nbsp;&nbsp;
      Last Name: <input type="text" name="lastName"><br>
      E-mail: <input type="text" name="email"><br>
      Phone Number: <input name="areaCode" type="text" size="3" maxlength="3">
                          <input name="phoneNumber" type="text" size="10" maxlength="8"><br>
  Questions or Comments: <br>
  <textarea name="textarea"></textarea>
  <p>
 <input type="submit" name="Submit" value="Submit">
  <input name="reset" type="submit" id="reset" value="Reset">
 </p>
</form>


<form name="showForm1" id=" " style="display:none">

      First Name: <input type="text" name="firstName">&nbsp;&nbsp;&nbsp;
      Last Name: <input type="text" name="lastName"><br>
      E-mail: <input type="text" name="email"><br>
      Phone Number: <input name="areaCode" type="text" size="3" maxlength="3">
              <input name="phoneNumber" type="text" size="10" maxlength="8">
  <p> Group No: <input type="text" name="groupNumber">
    <br>
    ID: <input type="text" name="idNumber">
    <br>
    Date of Birth:
    <select name="birthDate">
      <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option>
      <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option>
      <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option>
      <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option>
      <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option>
      <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option>
      <option>31</option>
    </select>
      
    <select name="birthMonth">
      <option>Jan</option> <option>Feb</option> <option>Mar</option> <option>Apr</option>
        <option>May</option> <option>Jun</option> <option>Jul</option> <option>Aug</option>
      <option>Sep</option> <option>Oct</option> <option>Nov</option> <option>Dec</option>
    </select>
      
    <input name="birthYear" type="text" size="6" maxlength="4">
  <p>
 <input type="submit" name="Submit" value="Submit">
  <input name="reset" type="submit" id="reset" value="Reset">
 </p>
 
</form>


<form name="showForm3" id=" " style="display:none">
  Email: <input type="text" name="textfield2">
  <br> Username: <input name="userName" type="text" size="12">
    Password: <input name="password" type="text" size="12">
  <br>
  Group No:
  <input name="groupNumber" type="text" size="12">
  ID:
  <input name="idNumber" type="text" size="12">
  &nbsp;<br>
  Birthdate:
  <select name="birthDate">
    <option>1</option><option>2</option> <option>3</option> <option>4</option> <option>5</option>
    <option>6</option><option>7</option> <option>8</option> <option>9</option> <option>10</option>
    <option>11</option><option>12</option> <option>13</option> <option>14</option> <option>15</option>
    <option>16</option> <option>17</option> <option>18</option> <option>19</option><option>20</option>
    <option>21</option><option>22</option> <option>23</option> <option>24</option><option>25</option>
    <option>26</option> <option>2</option> <option>728</option> <option>29</option> <option>30</option>
    <option>31</option>
  </select>
 
  <select name="birthMonth">
    <option>Jan</option> <option>Feb</option> <option>Mar</option> <option>Apr</option><option>May</option>
    <option>Jun</option> <option>Jul</option> <option>Aug</option> <option>Sep</option> <option>Oct</option>
    <option>Nov</option><option>Dec</option>
  </select>
 
  <input name="birthYear" type="text" size="6" maxlength="4">
 <p>
 <input type="submit" name="Submit" value="Submit">
  <input name="reset" type="submit" id="reset" value="Reset">
 </p>
 
</form>


</body>
</html>


Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Something went wrong when it was pasted in... the elements are missing the "<" symbols!

If I understand correctly, you would want something like:
<INPUT TYPE=button VALUE="Submit" onClick="document.forms['form1'].submit();document.forms['form2'].submit()">

This would submit two forms at the same time.

I hope this helps!

Author

Commented:
thanks Alopederii, that was quick.  looks good to me--so i just put this code as the Submit button right?

now where and how do i refer both to the .asp file? you know the part that goes:

action="confirm.asp" method="post"...

Actually, replace the submit button with the input button.  It will subit the forms, though, as if it were a submit.

To refer to the asp files, put the action, etc. in the <FORM> tags like <FORM NAME=theformname action="confirm.asp" method="post">

Then when they click the <INPUT TYPE=button VALUE="Submit" onClick="document.forms['theformname'].submit();document.forms['form2'].submit()"> it will submit two forms.

One thing to consider, and I don't have much knowlegde of ASP so this may be a stupid question, but is your ASP able to hande two forms being submitted simultaneously?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
O.K. Alopederii, I've put the action="confirm.asp" method="post"... in the <form> tag of the main form and each of the hidden form.  everything seems to work fine and when i submit, a message comes up asking me if I want to download the file called confirm.asp.  I assume this is because there's something incomplete with my asp. file?

If you can confirm this is the case--that it is the ASP I need to look at, and not the Javascript them I will consider my question above answered and would like to accept and close the question upon your reply.  If it's the Javascript can you suggest anything?

thanks.
Prhaps you could change it to be one form, and all of the elements are submitted at the same time.  I believe that would work better.

To change the display:inline and other things like that without using more than one <FORM> tag, you can use <SPAN>, like <SPAN ID='yourID'>, then it would be changed like yourID.style.display='none', etc.
As to the download, that sounds like an ASP issue.
You might want to test the ASP page separately, just to make sure that it isn't a javascript problem.  If the form seems to be submitting okay, the javascript sounds like it is correct.

Author

Commented:
So you are saying that the message to download the ASP file could be a problem still on the HTML/Javascript side--due to confusion with 2 forms?

As I am no expert, is it possible for you to demonstrate the remedy you propose in the code above (I've fixed the tags by the way).  I hope the "new" way using <SPAN ID> will still allow various forms to appear if chosen?

Of if fixing the double form to submit code can be done, I'd take that too.

I've increased points for this elaborating on the question.

Thanks.
It might be the confusion of the two forms.

I'll work on the SPAN idea.  I am at work, and my break is just about over, so I'll post the solution later this evining, in about three hours.  Sorry for the inconvenience.

Commented:
If you're being prompted to download the ASP page, it's because your server doesn't support ASP.
champ -- it sounds like webwoman answered the question about weather it is a JavaScript error or an ASP error.  But anyways, here is the modified code.  Keep in mind that it is not cleaned up -- I commented out some <FORM> tags, etc. rather than removing them so that you could see what I did.  Also I didn't rename any variables or functions, even though it might make sense to do so.  Here it is:

<script>
<!--

var temp, temp1;
var group, groups;
var inquiries, questions;

formList=new Array("showForm2","showForm1","showForm3");

function buildArrays(){

groups = document.all("custType").length + 1 //+ 1 if for the drop down item select...

group=new Array(groups)

for (i=0; i<groups; i++) group[i]=new Array();

group[0][0]=new Option("---Please Select A Customer Type Above---"," ");

group[1][0]=new Option("---Please Select A Product Type----"," ");
group[1][1]=new Option("Bakery","47");
group[1][2]=new Option("Deli ","46");
group[1][3]=new Option("Meat","45");

group[2][0]=new Option("--Please Select A Product Type---"," ");
group[2][1]=new Option("Vegtables ","115");
group[2][2]=new Option("Frozen Dinners ","116");
group[2][3]=new Option("Dairy Products ","45");

group[3][0]=new Option("--Please Select A Product Type---"," ");
group[3][1]=new Option("Cosmetics","115");
group[3][2]=new Option("Dental","116");
group[3][3]=new Option("Bandages","45");


temp=document.contactForm.productCat;

questions=temp.options.length
inquiries=new Array(groups)
for (i=0; i<groups; i++)  {
   inquiries[i]=new Array(group[i].length);
   for (j=0; j<group[i].length; j++)  {
        inquiries[i][j]=new Array()  
   }
}

inquiries[0][0][0]=new Option("---Select---"," ");
inquiries[1][0][0]=new Option("---Please Select From the Menu Above---");
inquiries[1][1][0]=new Option("Please Select An Inquiry Type");
inquiries[1][1][1]=new Option("bakeryInq1","showForm1") ; // *
inquiries[1][1][2]=new Option("bakeryInq2","nonshowForm1");
inquiries[1][1][3]=new Option("bakery","showForm3");

inquiries[1][2][0]=new Option("Please Select An Inquiry Type");
inquiries[1][2][1]=new Option("deliInq1","showForm1");
inquiries[1][2][2]=new Option("deliInq2","showForm2");
inquiries[1][2][3]=new Option("deliInq3","showForm3");

inquiries[1][3][0]=new Option("Please Select An Inquiry Type");
inquiries[1][3][1]=new Option("meatInq1","showForm1");
inquiries[1][3][2]=new Option("meatInq2","showForm2");
inquiries[1][3][3]=new Option("meatInq3","showForm3");
inquiries[1][3][4]=new Option("meatInq4","showForm2");
inquiries[1][3][5]=new Option("meatInq5","showForm3");

inquiries[2][0][0]=new Option("---Please From the Menu Above---");
inquiries[2][1][0]=new Option("Please Select An Inquiry Type");
inquiries[2][1][1]=new Option("veggiesInq1","showForm1");
inquiries[2][1][2]=new Option("veggiesInq2","showForm2");
inquiries[2][1][3]=new Option("veggiesInq3","showForm3");

inquiries[2][2][0]=new Option("Please Select An Inquiry Type");
inquiries[2][2][1]=new Option("frozen1","showForm1"); //*
inquiries[2][2][2]=new Option("frozen2","showForm2");
inquiries[2][2][3]=new Option("frozen3","showForm3");

inquiries[2][3][0]=new Option("Please Select An Inquiry Type"," ");
inquiries[2][3][1]=new Option("dairyInq1","showForm1");
inquiries[2][3][2]=new Option("dairyInq2","showForm2");
inquiries[2][3][3]=new Option("dairyInq3","showForm3");

inquiries[3][0][0]=new Option("---Please Select From the Menu Above---");
inquiries[3][1][0]=new Option("Please Select An Inquiry Type");
inquiries[3][1][1]=new Option("cosmeticsInq","showForm1");
inquiries[3][1][2]=new Option("cosmeticsInq2","showForm2");
inquiries[3][1][3]=new Option("cosmeticsInq3","showForm3");
inquiries[3][1][4]=new Option("cosmetictsInq4","showForm3");
inquiries[3][1][5]=new Option("cosmetictsInq5","showForm1");

inquiries[3][2][0]=new Option("Please Select An Inquiry Type");
inquiries[3][2][1]=new Option("dentalInq1","showForm1");
inquiries[3][2][2]=new Option("dentalInq2","showForm2");
inquiries[3][2][3]=new Option("dentalInq3","showForm3");
inquiries[3][2][4]=new Option("dentalInq4","showForm1");
inquiries[3][2][5]=new Option("dentalInq5","showForm3");

inquiries[3][3][0]=new Option("Please Select An Inquiry Type","showForm1");
inquiries[3][3][1]=new Option("firstAid1","showForm1");
inquiries[3][3][2]=new Option("firstAid2","showForm2");
inquiries[3][3][3]=new Option("firstAid3","showForm3");
inquiries[3][3][4]=new Option("firtsAid4","showForm1");
inquiries[3][3][5]=new Option("firstAid5","showForm3");

temp1=document.contactForm.inquiryType;

}

function nextGroup(x){

for (m=temp.options.length-1;m>0;m--) temp.options[m]=null;
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}

temp.options[0].selected=true;
nextGroup1(0);

}

function nextGroup1(y){

displayForm('');

var selRadio;

for (m=temp1.options.length-1;m>0;m--) temp1.options[m]=null;
for (i=0;i<inquiries[document.all("custType").length][y].length;i++)
{
   for(k=0;k<document.all("custType").length;k++) {
        if (document.contactForm.custType[k].checked == true) selRadio = k;          
   }
   temp1.options[i]=new
   

Option(inquiries[document.contactForm.custType[selRadio].value][y][i].text,inquiries[document.contactForm.custType

[selRadio].value][y][i].value);
}
temp1.options[0].selected=true

}

function nextGroup2(z){

displayForm(z.options[z.selectedIndex].value);

}

var appearFields = "";

function displayForm(formName){

for (var i=0;i<formList.length;i++) {
    if (formName!=formList[i]) {
eval(formList[i]+'span').style.display='none'; }
}

if (formName=='') { return false; }

var thisForm=eval(formName+'span');

thisForm.style.display='inline';

}      

//-->
</script>

<html>
<head>
<title>Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body onload="buildArrays();">

<form name="contactForm">

<table border="0" cellspacing="0" cellpadding="0">
<tr align="left">
<td nowrap height="11"> &nbsp;
<p>
<input name="custType" type="radio" value=1 onclick="nextGroup(this.value)">Delivery Truck1 <br>
<input name="custType" type="radio" value=2 onclick="nextGroup(this.value)">Delivery Truck 2<br>
<input name="custType" type="radio" value=3 onclick="nextGroup(this.value)">Delivery Truck 3<br>

</p>
<p>
<select name="productCat" size="1" onChange="nextGroup1(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Please Select A Customer Type Above--------------</option>
<option value=" " selected>---Please Select A Customer Type Above--------------</option>
</select>
</p>
<p>
<select name="inquiryType" size="1" onChange="nextGroup2(this)">
<option value=" " selected> </option>
<option value=" " selected>---Please Select A Customer Type Above----------------</option>
<option value=" " selected>---Please Select A Customer Type Above----------------</option>
</select>
</p>
</td>
</tr>

</table>
<!--</form>

<form name="showForm2">-->
<SPAN ID="showForm2span" style="display:none">

     First Name: <input type="text" name="firstName">&nbsp;&nbsp;&nbsp;
     Last Name: <input type="text" name="lastName"><br>
     E-mail: <input type="text" name="email"><br>
     Phone Number: <input name="areaCode" type="text" size="3" maxlength="3">
                      <input name="phoneNumber" type="text" size="10" maxlength="8"><br>
 Questions or Comments: <br>
 <textarea name="textarea"></textarea>
 <p>
<input type="submit" name="Submit" value="Submit">
 <input name="reset" type="submit" id="reset" value="Reset">
</p>
</SPAN>
<!--</form>-->


<SPAN ID="showForm1span" style="display:none">
<!--<form name="showForm1">-->

     First Name: <input type="text" name="firstName">&nbsp;&nbsp;&nbsp;
     Last Name: <input type="text" name="lastName"><br>
     E-mail: <input type="text" name="email"><br>
     Phone Number: <input name="areaCode" type="text" size="3" maxlength="3">
             <input name="phoneNumber" type="text" size="10" maxlength="8">
 <p> Group No: <input type="text" name="groupNumber">
   <br>
   ID: <input type="text" name="idNumber">
   <br>
   Date of Birth:
   <select name="birthDate">
     <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option>
     <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option>
     <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option>
     <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option>
     <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option>
     <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option>
     <option>31</option>
   </select>
     
   <select name="birthMonth">
     <option>Jan</option> <option>Feb</option> <option>Mar</option> <option>Apr</option>
       <option>May</option> <option>Jun</option> <option>Jul</option> <option>Aug</option>
     <option>Sep</option> <option>Oct</option> <option>Nov</option> <option>Dec</option>
   </select>
     
   <input name="birthYear" type="text" size="6" maxlength="4">
 <p>
<input type="submit" name="Submit" value="Submit">
 <input name="reset" type="submit" id="reset" value="Reset">
</p>
<!--</form>-->
</SPAN>




<SPAN ID="showForm3span" style="display:none">
<!--<form name="showForm3">-->
 Email: <input type="text" name="textfield2">
 <br> Username: <input name="userName" type="text" size="12">
   Password: <input name="password" type="text" size="12">
 <br>
 Group No:
 <input name="groupNumber" type="text" size="12">
 ID:
 <input name="idNumber" type="text" size="12">
 &nbsp;<br>
 Birthdate:
 <select name="birthDate">
   <option>1</option><option>2</option> <option>3</option> <option>4</option> <option>5</option>
   <option>6</option><option>7</option> <option>8</option> <option>9</option> <option>10</option>
   <option>11</option><option>12</option> <option>13</option> <option>14</option> <option>15</option>
   <option>16</option> <option>17</option> <option>18</option> <option>19</option><option>20</option>
   <option>21</option><option>22</option> <option>23</option> <option>24</option><option>25</option>
   <option>26</option> <option>2</option> <option>728</option> <option>29</option> <option>30</option>
   <option>31</option>
 </select>
 
 <select name="birthMonth">
   <option>Jan</option> <option>Feb</option> <option>Mar</option> <option>Apr</option><option>May</option>
   <option>Jun</option> <option>Jul</option> <option>Aug</option> <option>Sep</option> <option>Oct</option>
   <option>Nov</option><option>Dec</option>
 </select>
 
 <input name="birthYear" type="text" size="6" maxlength="4">
<p>
<input type="submit" name="Submit" value="Submit">
 <input name="reset" type="submit" id="reset" value="Reset">
</p>

 </SPAN>
</form>
</body>
</html>

Author

Commented:
looks good so far, Alopederii...question is, what do i do  with each Submit button this time around--to submit only the chosen Span ID along with contactForm?

last time it was:

<input type="button" value="Send Request" onClick="document.forms['contactForm'].submit();document.forms['showForm1'].submit()">

so to clarify, i need to submit only one of the sets below per transaction to the ASP page.

"contactForm" + "showForm1span" or
"contactForm" + "showForm2span" or
"contactForm" + "showForm3span"

sorry for the hassel--points increased for your patience!
What I had in mind was that you would need ony one form that would go to one ASP page -- and I thought that the ASP page would be programmed to figure out what form was selected.

This should work unless it is what webwoman mentioned, about your server not supporting ASP.

I don't think that there is a way to only submit partial form information depending on what is selected.  My guess is it needs to be done on the server side.

I hope that this helps...

That is generous of you to keep increasing the points, but it's not necessary.  Almost all of the experts here (and certainly all of the top experts) want to work with coders until their situation is resolved.  But thanks again!

Author

Commented:
so with the new code you are saying that i should sort out in ASP  which one was submited--using the Span ID?

and as for the previous code from you:

<input type="button" value="Send Request" onClick="document.forms['contactForm'].submit();document.forms['showForm1'].submit()">

might work to submit the mainForm and the selected form, but probably not because there isn't a way to submit a partial form?
With the new code you would need to sort it out with ASP -- correct.  But you would not sort it out by the SPAN.

In the ASP I think there would be a way that you could determine which drop downs were selected, and that information will tell you what SPAN (and form elements) was visible at the time.

I'm not sure how much ASP experience you have, but as I mentioned earlier I have very little.  If this is looking like an ASP question rather than a JavaScript question, you can post a low point question in the ASP section pointing to this thread.

Author

Commented:
Thanks for your help, Alopederii.  I took your earlier example as I think it is the closest to my original question.

I've also thought of another solution that I am pursuing to see where that leads so that I can work with more than one solution.  It's another question for a Javascript expert--have a look:

http://www.experts-exchange.com/Web/Web_Languages/Q_20403002.html
Thanks for the points!  I'll look into the other question.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial