codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Submit multiple forms with one button  cwilkey at 21:52 on Wednesday, March 30, 2005
 

Does anyone know how this can be accomplished? Here is what I've tried:

<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function submitForms()
{
document.form1.submit();
document.form2.submit();
}
//-->
</SCRIPT>
</HEAD>

<BODY>
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form1">
<INPUT TYPE="text" NAME="box1" size="20">
</FORM>
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form2">
<INPUT TYPE="text" NAME="box2" size="20">
</FORM>
<INPUT TYPE="button" value="Enviar" onClick="submitForms()">
</BODY>
</HTML>

This doesn't work. It only submits the second form for some reason. Any help would be greatly appreciated.


  Re: Submit multiple forms with one button  Kjazwilty at 01:36 on Thursday, March 31, 2005
 


It won't work like that cause you POST the speciffic form and all values in it.
I't the same as writing two letters, posting one and be suprised because only one vas received.. huh - bad example ;-P


Here are some examples on how it can be solved:


#1:
"function submitFormsById(arFormsSubmit [Array])"
- Submit all forms with id passed in Array

#2:
"function submitAllDocumentForms()"
- Submit all forms in document

Both examples uses the function
"function appendFormVals2Form(frmCollectFrom [obj], frmCollector [obj])"

[ Example Code: ]
<HTML>
<HEAD>
<TITLE>Submit Multiple Forms</TITLE>
<style>form{height:25px;}</style>
<SCRIPT LANGUAGE="JavaScript">
/* Collect all forms passed by array and post it */
function submitFormsById(arFormsSubmit)
{
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
style.display = "none";
}

for(var ix = 0; ix<arFormsSubmit.length;ix++)
appendFormVals2Form(document.getElementById(arFormsSubmit[ix]), formCollector);

document.getElementById('form_post_container').appendChild(formCollector);
formCollector.submit();
}

/* Collect all forms in document to one and post it */
function submitAllDocumentForms() {
var arrDocForms = document.getElementsByTagName('form');
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
}

for(var ix=0;ix<arrDocForms.length;ix++) {
appendFormVals2Form(arrDocForms[ix], formCollector);
}

document.getElementById('form_post_container').appendChild(formCollector);
formCollector.submit();

}

/* Function: add all elements from ``frmCollectFrom´´ and append them to ``frmCollector´´ before returning ``frmCollector´´*/
function appendFormVals2Form(frmCollectFrom, frmCollector) {
var frm = frmCollectFrom.elements;
for(var ix = 0 ; ix < frm.length ; ix++)
frmCollector.appendChild(frm[ix]);
return frmCollector;
}

</SCRIPT>
</HEAD>

<BODY>

FORM1:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form1" id="form1">
<INPUT TYPE="text" NAME="box1" size="20" value="BOX1_value">
</FORM>
FORM2:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form2" id="form2">
<INPUT TYPE="text" NAME="box2" size="20" value="BOX2_value">
</FORM>
<hr>
FORM3:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form3" id="form3">
<INPUT TYPE="text" NAME="box3" size="20" value="BOX3_value">
</FORM>
FORM4:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form4" id="form4">
<INPUT TYPE="text" NAME="box4" size="20" value="BOX4_value">
</FORM>
FORM5:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form5" id="form5">
<INPUT TYPE="text" NAME="box5" size="20" value="BOX5_value">
</FORM>
FORM6:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form6" id="form6">
<INPUT TYPE="text" NAME="box6" size="20" value="BOX6_value">
</FORM>


<INPUT TYPE="button" value="Submit Form 1 & 2" onClick="submitFormsById(Array('form1','form2'))">
<INPUT TYPE="button" value="Submit Form 1 to 6" onClick="submitAllDocumentForms()">

</BODY>
</HTML>



Br,


  Re: Submit multiple forms with one button  cwilkey at 14:01 on Thursday, March 31, 2005
 

First off, thank you for your reply, however I tried your example and was still unsuccessful in submitting both forms. For some reason its only submitting the first for.

I've taken your code and simplified it to better meet my needs. It generates an error...

[CODE]

<HTML>
<HEAD>
<TITLE>Submit Multiple Forms</TITLE>
<style>form{height:25px;}</style>
<SCRIPT LANGUAGE="JavaScript">
/* Collect all forms passed by array and post it */
function submitFormsById(arFormsSubmit)
{
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
style.display = "none";
}

for(var ix = 0; ix<arFormsSubmit.length;ix++)
appendFormVals2Form(document.getElementById(arFormsSubmit[ix]), formCollector);

document.getElementById('form_post_container').appendChild(formCollector);
formCollector.submit();
}

/* Collect all forms in document to one and post it */
function submitAllDocumentForms() {
var arrDocForms = document.getElementsByTagName('form');
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
}

for(var ix=0;ix<arrDocForms.length;ix++) {
appendFormVals2Form(arrDocForms[ix], formCollector);
}

document.getElementById('form_post_container').appendChild(formCollector);
formCollector.submit();

}

/* Function: add all elements from ``frmCollectFrom´´ and append them to ``frmCollector´´ before returning ``frmCollector´´*/
function appendFormVals2Form(frmCollectFrom, frmCollector) {
var frm = frmCollectFrom.elements;
for(var ix = 0 ; ix < frm.length ; ix++)
frmCollector.appendChild(frm[ix]);
return frmCollector;
}

</SCRIPT>
</HEAD>

<BODY>

FORM1:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form1" id="form1">
<INPUT TYPE="text" NAME="box1" size="20" value="BOX1_value">
</FORM>
FORM2:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form2" id="form2">
<INPUT TYPE="text" NAME="box2" size="20" value="BOX2_value">
</FORM>

<INPUT TYPE="button" value="Submit Form 1 & 2" onClick="submitFormsById(Array('yourform','yourform2'))">

</BODY>
</HTML>


  Re: Submit multiple forms with one button  Kjazwilty at 14:28 on Thursday, March 31, 2005
 

Hi,

First of all the button onclick action is wrong.

You have:

INPUT TYPE="button" value="Submit Form 1 & 2" onClick="submitFormsById(Array('yourform','yourform2'))">


onclick event call the function submitFormsById,
as the name states it is BY ID.

In your document you have two forms with id=form1 and id=form2 - then you must pass them with their correct ID like this:

submitFormsById(Array('form1','form2'))


#2
Second it seems like i pasted the wrong code cause i can't see the form_post_container ,(refID) sorry - but this is easily solved by applying the whole she bang to the body instead like this:
document.body.appendChild(formCollector);

So finally the code becomes:

[CODE]

<HTML>
<HEAD>
<TITLE>Submit Multiple Forms</TITLE>
<style>form{height:25px;}</style>
<SCRIPT LANGUAGE="JavaScript">
/* Collect all forms passed by array and post it */
function submitFormsById(arFormsSubmit)
{
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
style.display = "none";
}

for(var ix = 0; ix<arFormsSubmit.length;ix++)
appendFormVals2Form(document.getElementById(arFormsSubmit[ix]), formCollector);

document.body.appendChild(formCollector);
formCollector.submit();
}

/* Collect all forms in document to one and post it */
function submitAllDocumentForms() {
var arrDocForms = document.getElementsByTagName('form');
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
}

for(var ix=0;ix<arrDocForms.length;ix++) {
appendFormVals2Form(arrDocForms[ix], formCollector);
}

document.getElementById('form_post_container').appendChild(formCollector);
formCollector.submit();

}

/* Function: add all elements from ``frmCollectFrom´´ and append them to ``frmCollector´´ before returning ``frmCollector´´*/
function appendFormVals2Form(frmCollectFrom, frmCollector) {
var frm = frmCollectFrom.elements;
for(var ix = 0 ; ix < frm.length ; ix++)
frmCollector.appendChild(frm[ix]);
return frmCollector;
}

</SCRIPT>
</HEAD>

<BODY>

FORM1:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form1" id="form1">
<INPUT TYPE="text" NAME="box1" size="20" value="BOX1_value">
</FORM>
FORM2:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form2" id="form2">
<INPUT TYPE="text" NAME="box2" size="20" value="BOX2_value">
</FORM>

<INPUT TYPE="button" value="Submit Form 1 & 2" onClick="submitFormsById(Array('form1','form2'))">

</BODY>
</HTML>


<Added>


ahhrrr ... sorry again - see i did not remove both occurences of

document.getElementById('form_post_container').appendChild(formCollector);

Replace the second one as well

document.getElementById('form_post_container').appendChild(formCollector);
===>>> TO ===>>>
document.body.appendChild(formCollector);



( This do not affect you in your current code tho.
You do not get error on this in the example cause the function where it is are not used..)


  Re: Submit multiple forms with one button  cwilkey at 14:30 on Thursday, March 31, 2005
 

Wonderful!! Wonderful!!

Thank you so much. I appreciate all of you kind help.

  Re: Submit multiple forms with one button  Kjazwilty at 14:33 on Thursday, March 31, 2005
 


If you do not have forms on tha page that should not be submitted - i'll recomend to use the other function (post all forms in document)

Then if you add other forms you do not have to think about ID's and to add to onclick and so forth... :P


[CODE]

<HTML>
<HEAD>
<TITLE>Submit Multiple Forms</TITLE>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">

/* Collect all forms in document to one and post it */
function submitAllDocumentForms() {
var arrDocForms = document.getElementsByTagName('form');
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
}

for(var ix=0;ix<arrDocForms.length;ix++) {
appendFormVals2Form(arrDocForms[ix], formCollector);
}

document.body.appendChild(formCollector);
formCollector.submit();

}

/* Function: add all elements from ``frmCollectFrom´´ and append them to ``frmCollector´´ before returning ``frmCollector´´*/
function appendFormVals2Form(frmCollectFrom, frmCollector) {
var frm = frmCollectFrom.elements;
for(var ix = 0 ; ix < frm.length ; ix++)
frmCollector.appendChild(frm[ix]);
return frmCollector;
}

</SCRIPT>
</HEAD>

<BODY>

FORM1:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form1" id="form1">
<INPUT TYPE="text" NAME="box1" size="20" value="BOX1_value">
</FORM>
FORM2:
<FORM METHOD=POST ACTION="/forum/test.html" NAME="form2" id="form2">
<INPUT TYPE="text" NAME="box2" size="20" value="BOX2_value">
</FORM>

<INPUT TYPE="button" value="Submit Form 1 & 2" onClick="submitAllDocumentForms()">

</BODY>
</HTML>

  Re: Submit multiple forms with one button  cwilkey at 14:40 on Thursday, March 31, 2005
 

Oh no! I tried your code and it works greathowever when I tried implementing it into mine it is still only submitting the first form.

Would you take a look? Please excuse the mess....

[code]

<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
<tr>
<td><!--webbot bot="Include" U-Include="/forum/includes/top.htm" TAG="BODY" --></td>
</tr>
<tr>
<td background="/forum/images/blue_background.jpg">
<img border="0" src="/forum/images/blue_background.jpg" width="40" height="15"></td>
</tr>
<tr>
<td> <html>
<!--#include file="/forum//includes/validTime.htm"-->
<!--#include file="/forum//includes/calendar.htm"-->
<!--#include file="/forum//includes/currency.htm"-->
<SCRIPT LANGUAGE="JavaScript">
// Cookie Functions //////////////////// (:)
// Set the cookie.
// SetCookie('your_cookie_name', 'your_cookie_value', exp);
// Get the cookie.
// var someVariable = GetCookie('your_cookie_name');



var expDays = .125;

var exp = new Date();

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));



function getCookieVal (offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1) { endstr = document.cookie.length; }

return unescape(document.cookie.substring(offset, endstr));

}



function GetCookie (name) {

var arg = name + "=";

var alen = arg.length;

var clen = document.cookie.length;

var i = 0;

while (i < clen) {

var j = i + alen;

if (document.cookie.substring(i, j) == arg) return getCookieVal (j);

i = document.cookie.indexOf(" ", i) + 1;

if (i == 0) break;

}

return null;

}



function SetCookie (name, value) {

var argv = SetCookie.arguments;

var argc = SetCookie.arguments.length;

var expires = (argc > 2) ? argv[2] : null;

var path = (argc > 3) ? argv[3] : null;

var domain = (argc > 4) ? argv[4] : null;

var secure = (argc > 5) ? argv[5] : false;

document.cookie = name + "=" + escape (value) +

((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +

((path == null) ? "" : ("; path=" + path)) +

((domain == null) ? "" : ("; domain=" + domain)) +

((secure == true) ? "; secure" : "");

}

// cookieForms saves form content of a page.
// use the following code to call it:
// <body onLoad="cookieForms('open', 'form_1', 'form_2', 'form_n')" onUnLoad="cookieForms('save', 'form_1', 'form_2', 'form_n')">
// It works on text fields and dropdowns in IE 5+
// It only works on text fields in Netscape 4.5





function cookieForms() {

var mode = cookieForms.arguments[0];



for(f=1; f<cookieForms.arguments.length; f++) {

formName = cookieForms.arguments[f];



if(mode == 'open') {

cookieValue = GetCookie('saved_'+formName);

if(cookieValue != null) {

var cookieArray = cookieValue.split('#cf#');



if(cookieArray.length == document[formName].elements.length) {

for(i=0; i<document[formName].elements.length; i++) {



if(cookieArray.substring(0,6) == 'select') { document[formName].elements.options.selectedIndex = cookieArray.substring(7, cookieArray.length-1); }

else if((cookieArray == 'cbtrue') || (cookieArray == 'rbtrue')) { document[formName].elements.checked = true; }

else if((cookieArray == 'cbfalse') || (cookieArray == 'rbfalse')) { document[formName].elements.checked = false; }

else { document[formName].elements.value = (cookieArray) ? cookieArray : ''; }

}

}

}

}



if(mode == 'save') {

cookieValue = '';

for(i=0; i<document[formName].elements.length; i++) {

fieldType = document[formName].elements.type;



if(fieldType == 'password') { passValue = ''; }

else if(fieldType == 'checkbox') { passValue = 'cb'+document[formName].elements.checked; }

else if(fieldType == 'radio') { passValue = 'rb'+document[formName].elements.checked; }

else if(fieldType == 'select-one') { passValue = 'select'+document[formName].elements.options.selectedIndex; }

else { passValue = document[formName].elements.value; }



cookieValue = cookieValue + passValue + '#cf#';

}

cookieValue = cookieValue.substring(0, cookieValue.length-4); // Remove last delimiter



SetCookie('saved_'+formName, cookieValue, exp);

}

}

}

// End -->

</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=330,height=302,left = 390,top = 462');");
}
// End -->
</script>
<script language="JavaScript"><!--
function setForm2Value() {
var selectedItem1 = document.yourform.stationtemp.selectedIndex;
var selectedItemValue1 = document.yourform.stationtemp.options[selectedItem1].value;
var selectedItemText1 = document.yourform.stationtemp.options[selectedItem1].text;

if (selectedItem1 != -1) {
document.yourform.station.value = selectedItemText1;
}
else {
document.yourform.station.value = "";

}
}
//--></script>
<SCRIPT LANGUAGE="JavaScript">
/* Collect all forms passed by array and post it */
function submitFormsById(arFormsSubmit)
{
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/confirm.html";
name = "formCollector";
id = "formCollector";
style.display = "none";
}

for(var ix = 0; ix<arFormsSubmit.length;ix++)
appendFormVals2Form(document.getElementById(arFormsSubmit[ix]), formCollector);

document.body.appendChild(formCollector);
formCollector.submit();
}

/* Collect all forms in document to one and post it */
function submitAllDocumentForms() {
var arrDocForms = document.getElementsByTagName('form');
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/confirm.html";
name = "formCollector";
id = "formCollector";
}

for(var ix=0;ix<arrDocForms.length;ix++) {
appendFormVals2Form(arrDocForms[ix], formCollector);
}

document.getElementById('form_post_container').appendChild(formCollector);
formCollector.submit();

}

/* Function: add all elements from ``frmCollectFrom´´ and append them to ``frmCollector´´ before returning ``frmCollector´´*/
function appendFormVals2Form(frmCollectFrom, frmCollector) {
var frm = frmCollectFrom.elements;
for(var ix = 0 ; ix < frm.length ; ix++)
frmCollector.appendChild(frm[ix]);
return frmCollector;
}

</SCRIPT>

<%
function ConvertDate(sDate)

dim sMM
dim sDD

if Trim(sDate) = "" then Exit Function

sMM = Month(CDate(sDate))
sDD = Day(CDate(sDate))
if Len(Trim(sMM)) < 2 then sMM = "0" & sMM
if Len(Trim(sDD)) < 2 then sDD = "0" & sDD

ConvertDate = sMM & "/index.html" & sDD & "/index.html" & Year(CDate(sDate))

end function

users = Request.form("users")
%>
</HEAD>
<BODY onload="cookieForms('open', 'yourform')" onunload="cookieForms('save', 'yourform')" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<body onload="cookieForms('open', 'yourform')" onunload="cookieForms('save', 'yourform')" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

</p>

<form name="yourform" method="POST" action="/forum/confirm.html" id="yourform">

<table border="0" width="647" id="table18" height="541">
<tr>
<td width="69" valign="top" align="right" height="11"><b>
<font size="1" face="Verdana">
Date:</font></b></td>
<td width="279" valign="top" colspan="2" height="11">
<font size="1" face="Verdana"><input type="text" name="ddate" size="20" style="font-family: Verdana; font-size: 8pt" tabindex="1" value="<%=ConvertDate(Date())%>"><font color="#000080">
</font><a href="#" onClick="getCalendarFor(document.yourform.ddate);return false"><span style="text-decoration: none">
<font color="#000080">[Choose Date]</font></span></a><font color="#000080">
</font>

</font></td>
<td width="10" valign="top" align="right" rowspan="16" height="519"> </td>
<td valign="top" width="271" rowspan="16" height="519">
<table border="0" width="123%" id="table19">
<tr>
<td>
<div align="center">
<table border="1" width="100%" id="table20" cellspacing="0" bgcolor="#000080" cellpadding="0" style="border-collapse: collapse" bordercolor="#FFFFFF">
<tr>
<td align="right" colspan="3">
<p align="center"><b>
<font size="1" face="Verdana" color="#FFFFFF">Type:</font></b></td>
</tr>
<tr>
<td align="right" width="87" bgcolor="#CCCCCC">
<font face="Verdana" size="1" color="#000080">Master
Control:</font></td>
<td align="center" bgcolor="#CCCCCC" width="21">
<font color="#000080" size="1" face="Verdana">
<input type="checkbox" name="mastercontrol" value="ON" style="font-family: Verdana; font-size: 8pt" tabindex="35"></font></td>
<td align="left" bgcolor="#CCCCCC" width="153">
<font face="Verdana" color="#000080" size="1">Log
Deviations</font></td>
</tr>
<tr>
<td align="right" width="87" bgcolor="#CCCCCC">
<font size="1" face="Verdana" color="#000080">
Technical:</font></td>
<td align="center" bgcolor="#CCCCCC" width="21">
<font color="#000080" size="1" face="Verdana">
<input type="checkbox" name="technical" value="ON" tabindex="36"></font></td>
<td align="left" bgcolor="#CCCCCC" width="153">
<font face="Verdana" color="#000080" size="1">
Equipment Failure</font></td>
</tr>
<tr>
<td align="right" width="87" bgcolor="#CCCCCC">
<font size="1" face="Verdana" color="#000080">News:</font></td>
<td align="center" bgcolor="#CCCCCC" width="21">
<font color="#000080" size="1" face="Verdana">
<input type="checkbox" name="news" value="ON" tabindex="37"></font></td>
<td align="left" bgcolor="#CCCCCC" width="153">
<font face="Verdana" color="#000080" size="1">News
Production Issues</font></td>
</tr>
<tr>
<td align="right" width="87" bgcolor="#CCCCCC">
<font face="Verdana" size="1" color="#000080">EAS</font></td>
<td align="center" bgcolor="#CCCCCC" width="21">
<font color="#000080" size="1" face="Verdana">
<input type="checkbox" name="eas" value="ON" tabindex="38"></font></td>
<td align="left" bgcolor="#CCCCCC" width="153">
<font face="Verdana" color="#000080" size="1">All
EAS activity</font></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<table border="0" width="248" id="table21" cellspacing="0">
<tr>
<td width="94" rowspan="3">

<select name="stationtemp" size="31" tabindex="11" style="font-family: Verdana; font-size: 8pt">
<option value="WSJV">WSJV
<option value="KTTC">KTTC
<option value="WVVA">WVVA
<option value="KTIV">KTIV
<option value="WREX">WREX
<option value="WKOW">WKOW
<option value="WXOW">WXOW
<option value="WQOW">WQOW
<option value="XO/QOCOMBO" >XO/QO COMBO
<option value="WAOW" >WAOW
<option value="WYOW">WYOW
<option value="AO/YOCOMBO">AO/YO COMBO
<option value="CGEM" >CGEM
<option value="WGEM-TV">WGEM-TV
<option value="WGEM/CGEM">WGEM/CGEM</option>
<option value="WGEM-ALL">WGEM-ALL</option>
<option value="WGEM-AM">WGEM-AM
<option value="WGEM-FM">WGEM-FM
<option value="WGEM-AM/FM">WGEM-AM/FM</option>
<option value="RockfordCNN">RockfordCNN
<option value="RochesterCNN">RochesterCNN
<option value="LaCrosseCNN">LaCrosseCNN
<option value="WEWB">WEWB
<option value="KWBR">KWBR
<option value="WBB">WBB
<option value="KXWB">KXWB
<option value="WBR">WBR
<option value="WBWA">WBWA
<option value="WBCZ">WBCZ
<option value="SHOWS">SHOWS
<option value="WINET">WINET
</select></td>
<td width="27" rowspan="3">

<input type="button" value=" > " onClick="setForm2Value()"></td>
<td width="113" height="154" valign="top">
<b><font face="Verdana" size="1"><br>
</font></b><br>
</tr>
<tr>
<td width="113" height="179" valign="top">
<b><font face="Verdana" size="1">Station</font></b><br>
<input type="textbox" name="station" value="" size="15" style="font-family: Verdana; font-size: 8pt"></tr>
</tr>
<tr>
<td width="113">
 </tr>
</tr>
</table>

</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="69" valign="top" align="right" height="21"><font face="Verdana" size="1"><b>Author:</b></font></td>
<td width="279" valign="top" colspan="2" height="21">
<font face="Verdana" size="1">
<input type="text" name="author" size="30" style="font-family: Verdana; font-size: 8pt" tabindex="39" value="<%=users%>"></font></td>
</tr>
<tr>
<td width="69" valign="top" align="right" height="84"><b>
<font size="1" face="Verdana">
Description:</font></b><p> </td>
<td width="279" valign="top" colspan="2" height="84">
<font size="1" face="Verdana">
<textarea rows="6" name="description" cols="43" style="font-family: Verdana; font-size: 8pt" tabindex="2"></textarea></font></td>
</tr>
<tr>
<td width="69" valign="top" align="right" height="97"><b>
<font size="1" face="Verdana">
Resolution:</font></b></td>
<td width="279" valign="top" colspan="2" height="97">
<font size="1" face="Verdana">
<textarea rows="7" name="resolution" cols="43" style="font-family: Verdana; font-size: 8pt" tabindex="3"></textarea></font></td>
</tr>
<tr>
<td width="69" valign="top" align="center" bgcolor="#000080" height="14">
<b><font face="Verdana" size="1" color="#FFFFFF">Time</font></b></td>
<td width="152" valign="top" align="center" bgcolor="#000080" height="14">
<b><font face="Verdana" size="1" color="#FFFFFF">
Advertiser/Location</font></b></td>
<td width="120" valign="top" align="center" bgcolor="#000080" height="14">
<b><font face="Verdana" size="1" color="#FFFFFF">Contract #</font></b></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime1" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4"></font></td>
<td width="152" valign="top" height="24" align="center">
<input type="text" name="advertiser1" size="20" tabindex="5" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" height="24" align="center">
<input type="text" name="contract1" size="16" tabindex="6" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime2" onBlur="return IsValidTime(document.yourform.dtime2.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="7"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser2" size="20" tabindex="8" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract2" size="16" tabindex="9" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime3" onBlur="return IsValidTime(document.yourform.dtime3.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="10"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser3" size="20" tabindex="11" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract3" size="16" tabindex="12" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime4" onBlur="return IsValidTime(document.yourform.dtime4.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="13"></font></td>
<td width="152" valign="top" height="24" align="center">
<input type="text" name="advertiser4" size="20" tabindex="14" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" height="24" align="center">
<input type="text" name="contract4" size="16" tabindex="15" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime5" onBlur="return IsValidTime(document.yourform.dtime5.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="16"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser5" size="20" tabindex="17" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract5" size="16" tabindex="18" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime6" onBlur="return IsValidTime(document.yourform.dtime6.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="19"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser6" size="20" tabindex="20" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract6" size="16" tabindex="21" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime7" onBlur="return IsValidTime(document.yourform.dtime7.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="22"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser7" size="20" tabindex="23" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract7" size="16" tabindex="24" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime8" onBlur="return IsValidTime(document.yourform.dtime8.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="25"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser8" size="20" tabindex="26" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract8" size="16" tabindex="27" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime9" onBlur="return IsValidTime(document.yourform.dtime9.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="28"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser9" size="20" tabindex="29" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract9" size="16" tabindex="30" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="24">
<font size="1" face="Verdana">
<input type="text" name="dtime10" onBlur="return IsValidTime(document.yourform.dtime10.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="31"></font></td>
<td width="152" valign="top" align="center" height="24">
<input type="text" name="advertiser10" size="20" tabindex="32" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="24">
<input type="text" name="contract10" size="16" tabindex="33" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="69" valign="top" align="center" height="12">
</td>
<td width="152" valign="top" align="center" height="12">
<p align="left"><input type="submit" value="Submit" onClick="submitFormsById(Array('yourform','yourform2'))" name="B1" style="font-family: Verdana; font-size: 8pt"> <input type="reset" value="Reset" name="B2" style="font-family: Verdana; font-size: 8pt"></td>
<td width="120" valign="top" align="center" height="12">
<font face="Verdana" size="1">
<A HREF="javascript:popUp('http://10.1.0.43/more.asp')">
[MORE]</A></font></td>
</tr>
</table>

</form>
<form method="POST" name="yourform2" action="/forum/confirm.html" id="yourform2">

<table border="0" width="305" id="table22" height="25">
<tr>
<td width="56" valign="top" align="center" height="10">
<font size="1" face="Verdana">
<input type="text" name="dtime11" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime11")%>"></font></td>
<td width="128" valign="top" height="10" align="center">
<input type="text" name="advertiser11" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser11")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="10" align="center">
<input type="text" name="contract11" size="16" tabindex="6" value="<%=Request.Cookies ("contract11")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="12">
<font size="1" face="Verdana">
<input type="hidden" name="dtime12" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime12")%>"></font></td>
<td width="128" valign="top" height="12" align="center">
<input type="hidden" name="advertiser12" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser12")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="12" align="center">
<input type="hidden" name="contract12" size="16" tabindex="6" value="<%=Request.Cookies ("contract12")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="11">
<font size="1" face="Verdana">
<input type="hidden" name="dtime13" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime13")%>"></font></td>
<td width="128" valign="top" height="11" align="center">
<input type="hidden" name="advertiser13" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser13")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="11" align="center">
<input type="hidden" name="contract13" size="16" tabindex="6" value="<%=Request.Cookies ("contract13")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="6">
<font size="1" face="Verdana">
<input type="hidden" name="dtime14" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime14")%>"></font></td>
<td width="128" valign="top" height="6" align="center">
<input type="hidden" name="advertiser14" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser14")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="6" align="center">
<input type="hidden" name="contract14" size="16" tabindex="6" value="<%=Request.Cookies ("contract14")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="10">
<font size="1" face="Verdana">
<input type="hidden" name="dtime15" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime15")%>"></font></td>
<td width="128" valign="top" height="10" align="center">
<input type="hidden" name="advertiser15" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser15")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="10" align="center">
<input type="hidden" name="contract15" size="16" tabindex="6" value="<%=Request.Cookies ("contract15")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="10">
<font size="1" face="Verdana">
<input type="hidden" name="dtime16" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime16")%>"></font></td>
<td width="128" valign="top" height="10" align="center">
<input type="hidden" name="advertiser16" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser16")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="10" align="center">
<input type="hidden" name="contract16" size="16" tabindex="6" value="<%=Request.Cookies ("contract16")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="12">
<font size="1" face="Verdana">
<input type="hidden" name="dtime17" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime17")%>"></font></td>
<td width="128" valign="top" height="12" align="center">
<input type="hidden" name="advertiser17" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser17")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="12" align="center">
<input type="hidden" name="contract17" size="16" tabindex="6" value="<%=Request.Cookies ("contract17")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="8">
<font size="1" face="Verdana">
<input type="hidden" name="dtime18" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime18")%>"></font></td>
<td width="128" valign="top" height="8" align="center">
<input type="hidden" name="advertiser18" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser18")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="8" align="center">
<input type="hidden" name="contract18" size="16" tabindex="6" value="<%=Request.Cookies ("contract18")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="8">
<font size="1" face="Verdana">
<input type="hidden" name="dtime19" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime19")%>"></font></td>
<td width="128" valign="top" height="8" align="center">
<input type="hidden" name="advertiser19" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser19")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="8" align="center">
<input type="hidden" name="contract19" size="16" tabindex="6" value="<%=Request.Cookies ("contract19")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
<tr>
<td width="56" valign="top" align="center" height="10">
<font size="1" face="Verdana">
<input type="hidden" name="dtime20" onBlur="return IsValidTime(document.yourform.dtime1.value);" size="8" style="font-family: Verdana; font-size: 8pt" tabindex="4" value="<%=Request.Cookies ("dtime20")%>"></font></td>
<td width="128" valign="top" height="10" align="center">
<input type="hidden" name="advertiser20" size="20" tabindex="5" value="<%=Request.Cookies ("advertiser20")%>" style="font-family: Verdana; font-size: 8pt"></td>
<td width="104" valign="top" height="10" align="center">
<input type="hidden" name="contract20" size="16" tabindex="6" value="<%=Request.Cookies ("contract20")%>" style="font-family: Verdana; font-size: 8pt"></td>
</tr>
</table>

</form>
<p></p></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<script language="JavaScript">
if (document.all) {
document.writeln("<div id=\"PopUpCalendar\" style=\"position:absolute; left:0px; top:0px; z-index:7; width:200px; height:77px; overflow: visible; visibility: hidden; background-color: #FFFFFF; border: 1px none #000000\" onMouseOver=\"if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}\" onMouseOut=\"ppcTI=setTimeout(\'hideCalendar()\',500)\">");
document.writeln("<div id=\"monthSelector\" style=\"position:absolute; left:0px; top:0px; z-index:9; width:181px; height:27px; overflow: visible; visibility:inherit\">");}
else if (document.layers) {
document.writeln("<layer id=\"PopUpCalendar\" pagex=\"0\" pagey=\"0\" width=\"200\" height=\"200\" z-index=\"100\" visibility=\"hide\" bgcolor=\"#FFFFFF\" onMouseOver=\"if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}\" onMouseOut=\"ppcTI=setTimeout('hideCalendar()',500)\">");
document.writeln("<layer id=\"monthSelector\" left=\"0\" top=\"0\" width=\"181\" height=\"27\" z-index=\"9\" visibility=\"inherit\">");}
else {
document.writeln("<p><font color=\"#FF0000\"><b>Error ! The current browser is either too old or too modern (usind DOM document structure).</b></font></p>");}
</script>
<noscript><p><font color="#FF0000"><b>JavaScript is not activated !</b></font></p></noscript>
<table border="1" cellspacing="1" cellpadding="2" width="200" bordercolorlight="#000000" bordercolordark="#000000" vspace="0" hspace="0" id="table11"><form name="ppcMonthList"><tr><td align="center" bgcolor="#CCCCCC"><a href="javascript:moveMonth('Back')" onMouseOver="window.status=' ';return true;"><font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b>< </b></font></a><font face="MS Sans Serif, sans-serif" size="1">
<select name="sItem" onMouseOut="if(ppcIE){window.event.cancelBubble = true;}" onChange="switchMonth(this.options[this.selectedIndex].value)" style="font-family: 'MS Sans Serif', sans-serif; font-size: 9pt"><option value="0" selected>2000 • January</option><option value="1">2000 • February</option><option value="2">2000 • March</option><option value="3">2000 • April</option><option value="4">2000 • May</option><option value="5">2000 • June</option><option value="6">2000 • July</option><option value="7">2000 • August</option><option value="8">2000 • September</option><option value="9">2000 • October</option><option value="10">2000 • November</option><option value="11">2000 • December</option><option value="0">2001 • January</option></select></font><a href="javascript:moveMonth('Forward')" onMouseOver="window.status=' ';return true;"><font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b> ></b></font></a></td></tr></form></table>
<table border="1" cellspacing="1" cellpadding="2" bordercolorlight="#000000" bordercolordark="#000000" width="200" vspace="0" hspace="0" id="table12"><tr align="center" bgcolor="#CCCCCC"><td width="20" bgcolor="#FFFFCC"><b><font face="MS Sans Serif, sans-serif" size="1">Su</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">Mo</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">Tu</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">We</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">Th</font></b></td><td width="20"><b><font face="MS Sans Serif, sans-serif" size="1">Fr</font></b></td><td width="20" bgcolor="#FFFFCC"><b><font face="MS Sans Serif, sans-serif" size="1">Sa</font></b></td></tr></table>
<script language="JavaScript">
if (document.all) {
document.writeln("</div>");
document.writeln("<div id=\"monthDays\" style=\"position:absolute; left:0px; top:52px; z-index:8; width:200px; height:17px; overflow: visible; visibility:inherit; background-color: #FFFFFF; border: 1px none #000000\"> </div></div>");}
else if (document.layers) {
document.writeln("</layer>");
document.writeln("<layer id=\"monthDays\" left=\"0\" top=\"52\" width=\"200\" height=\"17\" z-index=\"8\" bgcolor=\"#FFFFFF\" visibility=\"inherit\"> </layer></layer>");}
else {/*NOP*/}
</script>
</body>

</html>
</td>
</tr>
</table>


  Re: Submit multiple forms with one button  Kjazwilty at 15:16 on Thursday, March 31, 2005
 

who... that was a lot of text... :)

change type=submit to type=button

<input type="button" value="Submit" onClick="submitFormsById(Array('yourform','yourform2'))" name="B1" style="font-family: Verdana; font-size: 8pt">



  Re: Submit multiple forms with one button  cwilkey at 17:23 on Thursday, March 31, 2005
 

This is the craziest thing...its only submitting certain fields - not all of them. This is nuts. Any suggestions?

  Re: Submit multiple forms with one button  cwilkey at 17:26 on Thursday, March 31, 2005
 

It appears to only be submitting every other form field. So, if there are two fields fields in form1 and one field in form2...it will only submit field1 and field 3.

  Re: Submit multiple forms with one button  Kjazwilty at 20:16 on Thursday, March 31, 2005
 

try to replace the submitFormsById function with this one:


function submitFormsById(arFormsSubmit)
{
var formCollector = document.createElement("form");
with(formCollector)
{
method = "post";
action = "/forum/test.html";
name = "formCollector";
id = "formCollector";
style.display = "none";
}

for(var ix = 0; ix<arFormsSubmit.length;ix++)
formCollector=appendFormVals2Form(document.getElementById(arFormsSubmit[ix]), formCollector);

document.body.appendChild(formCollector);
formCollector.submit();
}

  Re: Submit multiple forms with one button  cwilkey at 21:57 on Thursday, March 31, 2005
 

Nope...its still only submitting every other field.

  Re: Submit multiple forms with one button  Kjazwilty at 08:20 on Friday, April 01, 2005
 

Ok, - can go over your form's - but do not have time at the moment. It's a bit tricky since i do not have any .asp interface to test on - but tho. I'll give it a try if you have not soved it..

  Re: Submit multiple forms with one button  cwilkey at 13:43 on Friday, April 01, 2005
 

Great. I've already posted my form code....it take up most of the page..here is the "/forum/confirm.html" page.

<html>
<%
ddate = Request.form("ddate")
dtime = Request.form("dtime")
contractno = Request.form("contractno")
dcost = Request.form("dcost")
author = Request.form("author")
description = Request.form("description")
resolution = Request.form("resolution")
mastercontrol = Request.form("mastercontrol")
news = Request.form("news")
technical = Request.form("technical")
station = Request.form("station")
%>
<head>
<title>New Page 1</title>
</head>

<body>
<%
Function StripQuote(TextIn)
TextIn=Replace(TextIn,"'","''")
StripQuote=TextIn
End Function

Dim myConnString
Dim myConnection
Dim mySQL

myConnString = Application("discrep_ConnectionString")
Set myConnection = Server.CreateObject("ADODB.Connection")
myConnection.Open myConnString

mySQL= "INSERT INTO Results"
mySQL= mySQL & "(ddate,dtime1,dtime2,dtime3,dtime4,dtime5,dtime6,dtime7,dtime8,dtime9,dtime10,advertiser1,advertiser2,advertiser3,advertiser4,advertiser5,advertiser6,advertiser7,advertiser8,advertiser9,advertiser10,contract1,contract2,contract3,contract4,contract5,contract6,contract7,contract8,contract9,contract10,dtime11,dtime12,dtime13,dtime14,dtime15,dtime16,dtime17,dtime18,dtime19,dtime20,advertiser11,advertiser12,advertiser13,advertiser14,advertiser15,advertiser16,advertiser17,advertiser18,advertiser19,advertiser20,contract11,contract12,contract13,contract14,contract15,contract16,contract17,contract18,contract19,contract20,description,resolution,author,mastercontrol,technical,news,eas,station)"
mySQL= mySQL & "VALUES ('" & Request.Form("ddate") & "','"
mySQL= mySQL & Request.Form("dtime1") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime2") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime3") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime4") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime5") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime6") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime7") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime8") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime9") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime10") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser1") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser2") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser3") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser4") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser5") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser6") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser7") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser8") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser9") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser10") & "'"
mySQL= mySQL & ",'" & Request.Form("contract1") & "'"
mySQL= mySQL & ",'" & Request.Form("contract2") & "'"
mySQL= mySQL & ",'" & Request.Form("contract3") & "'"
mySQL= mySQL & ",'" & Request.Form("contract4") & "'"
mySQL= mySQL & ",'" & Request.Form("contract5") & "'"
mySQL= mySQL & ",'" & Request.Form("contract6") & "'"
mySQL= mySQL & ",'" & Request.Form("contract7") & "'"
mySQL= mySQL & ",'" & Request.Form("contract8") & "'"
mySQL= mySQL & ",'" & Request.Form("contract9") & "'"
mySQL= mySQL & ",'" & Request.Form("contract10") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime11") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime12") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime13") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime14") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime15") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime16") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime17") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime18") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime19") & "'"
mySQL= mySQL & ",'" & Request.Form("dtime20") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser11") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser12") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser13") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser14") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser15") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser16") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser17") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser18") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser19") & "'"
mySQL= mySQL & ",'" & Request.Form("advertiser20") & "'"
mySQL= mySQL & ",'" & Request.Form("contract11") & "'"
mySQL= mySQL & ",'" & Request.Form("contract12") & "'"
mySQL= mySQL & ",'" & Request.Form("contract13") & "'"
mySQL= mySQL & ",'" & Request.Form("contract14") & "'"
mySQL= mySQL & ",'" & Request.Form("contract15") & "'"
mySQL= mySQL & ",'" & Request.Form("contract16") & "'"
mySQL= mySQL & ",'" & Request.Form("contract17") & "'"
mySQL= mySQL & ",'" & Request.Form("contract18") & "'"
mySQL= mySQL & ",'" & Request.Form("contract19") & "'"
mySQL= mySQL & ",'" & Request.Form("contract20") & "'"
mySQL= mySQL & ",'" & StripQuote(Request.Form("description")) & "'"
mySQL= mySQL & ",'" & StripQuote(Request.Form("resolution")) & "'"
mySQL= mySQL & ",'" & Request.Form("author") & "'"
mySQL= mySQL & ",'" & Request.Form("mastercontrol") & "'"
mySQL= mySQL & ",'" & Request.Form("technical") & "'"
mySQL= mySQL & ",'" & Request.Form("news") & "'"
mySQL= mySQL & ",'" & Request.Form("eas") & "'"
mySQL= mySQL & ",'" & Request.Form("station") & "')"


'Get max id result
Set rs = Server.CreateObject("ADODB.recordset")
Dim MaxSelect
MaxSelect = "SELECT MAX(ID) as lastId FROM Results"
rs.open MaxSelect, myConnection

if not rs.EOF then
myUrl = rs("Lastid")
end if
rs.close

response.write mysql
myConnection.Execute mySQL
myConnection.Close
Set myConnection = Nothing
%>

<!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM admin WHERE station = '::station::'"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="discrep"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=19&station=200&news=200&technical=200&mastercontrol=200&eas=200&"
fp_iDisplayCols=4
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<p>
<%

If Request.form("technical") = "ON" then

Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.qni.biz"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

Set oMail.Configuration = oMailConfig
oMail.From = Request.form("author")
oMail.To = FP_FieldVal(fp_rs,"technical")
oMail.Subject = "Discrepancy Report"
oMail.HTMLBody = "<a href=http://10.1.0.43/results.asp?ID=" & myURL & ">Click Here to view a discrepancy report."

oMail.Send

Else
Response.write ""
End If

If Request.form("news") = "ON" then

Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.qni.biz"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

Set oMail.Configuration = oMailConfig
oMail.From = Request.form("author")
oMail.To = FP_FieldVal(fp_rs,"news")
oMail.Subject = "Disprepancy Report"
oMail.HTMLBody = "<a href=http://10.1.0.43/results.asp?ID=" & myURL & ">Click Here to view a discrepancy report."

oMail.Send

Else
Response.write ""
End If

If Request.form("mastercontrol") = "ON" then

Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.qni.biz"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

Set oMail.Configuration = oMailConfig
oMail.From = Request.form("author")
oMail.To = FP_FieldVal(fp_rs,"mastercontrol")
oMail.Subject = "Discrepancy Report"
oMail.HTMLBody = "<a href=http://10.1.0.43/results.asp?ID=" & myURL & ">Click Here to view a discrepancy report."

oMail.Send

Else
Response.write ""
End If

If Request.form("eas") = "ON" then

Set oMail = Server.CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject ("CDO.Configuration")

oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.qni.biz"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update

Set oMail.Configuration = oMailConfig
oMail.From = Request.form("author")
oMail.To = FP_FieldVal(fp_rs,"eas")
oMail.Subject = "Discrepancy Report"
oMail.HTMLBody = "<a href=http://10.1.0.43/results.asp?ID=" & myURL & ">Click Here to view a discrepancy report."

oMail.Send

Set oMail = Nothing
Set oMailConfig = Nothing

Else
Response.write ""
End If
%>

<p></p>
<!--#include file="_fpclass/fpdbrgn2.inc"-->

<p align="center"><i><b><font color="#000080" face="Arial" size="4">Thank You. Your submission is complete.</font></b></i>
</p>
</body>

</html>








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Such A Newbie - Mailing Label Program
•  Classified Script
•  Re: saving??
•  Re: Date script issues
•  Re: HTML using javaScript help..
•  Write text strings to Serial Port
•  kindly help.i am new to perl
•  new to VB and learning
•  Filtering a DataGridView


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007