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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox value

Status
Not open for further replies.

Jay319

Technical User
Feb 21, 2003
16
0
0
US
I have a mysql database that contains fields for "zZones" and "zQuantity" Each Zone has a Quantity attached to it.

I have an insert form with checkboxes. When you click a checkbox it activates a javascript that puts the total Quantity of the checkboxes selected into a total field.

My problem is that every checkbox is inserting the first quantity value from the database.

How can I write the following so that it matches the zone to the correct quatity value ...
Code:
<input type="checkbox" name="ZATF1" id="ZATF1" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>

thanks, jay
 
That must be what your code is putting as a value, which would be in the code we cannot see.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
There are around 11 checkboxes and the database value it is putting in each is based on zQuantity value.
Code:
value="<%=(rsZones.Fields.Item("zQuantity").Value)%>
For example that quantity may be 351. No matter what box I check I get the 351 value. The second checkbox is not moving to the next record so I can get the second value.

I was wondering if there was some sort of "if, then" statement I could put in the value area of the checkbox that said ...

if zZone = ZATF1 then select this quantity from zQuantity

thanks, Jay
 
Your code that creates the checkboxes and their associated values most be in error.

Without the loop that writes the value ALL OF IT and the rendered HTML (or a link to the page) you are NOT going to get an answer.

We cannot second guess at what your code is doing.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Chris - thanks for looking at this.

Here is a link to the page ...
and here is the complete page code ...

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../WA_DataAssist/WA_AppBuilder_VB.asp" -->
<!--#include file="../Connections/connInsert.asp" -->
<%
Dim rsAccount
Dim rsAccount_numRows

Set rsAccount = Server.CreateObject("ADODB.Recordset")
rsAccount.ActiveConnection = MM_connInsert_STRING
rsAccount.Source = "SELECT *  FROM inserttracker.publications  WHERE pubName LIKE 'Ames%'"
rsAccount.CursorType = 0
rsAccount.CursorLocation = 2
rsAccount.LockType = 1
rsAccount.Open()

rsAccount_numRows = 0
%>
<%
Dim rsZones
Dim rsZones_numRows

Set rsZones = Server.CreateObject("ADODB.Recordset")
rsZones.ActiveConnection = MM_connInsert_STRING
rsZones.Source = "SELECT *  FROM inserttracker.zones  WHERE zPublication LIKE 'Ames%'"
rsZones.CursorType = 0
rsZones.CursorLocation = 2
rsZones.LockType = 1
rsZones.Open()

rsZones_numRows = 0
%>
<%
' WA Application Builder Insert
if (cStr(Request.Form("Insert.x")) <> "")  then
  WA_connection = MM_connInsert_STRING
  WA_table = "inserttracker.ames_booked"
  WA_sessionName = "WADA_Insert_inserttrackerames_booked"
  WA_redirectURL = "ames_booked_Detail.asp"
  WA_keepQueryString = false
  WA_indexField = "bkID"
  WA_fieldNamesStr = "bkPublication|bkDate|bkSales_Person|bkCustomer|bkAccount_Code|bkInsertName|bkInsertCode|bkRun_Date|bkQuantity|bkPage_Count|ZATF1|ZATF2|ZATF3|ZATF4|ZATF5|ZATF6|ZATF7|ZATF8|ZATF9|ZATF10|ZATF11|ZASAT1|ZASAT2|ZASAT3|ZASAT4|ZASAT5|ZASAT6|ZASAT7|ZASAT8|ZASAT9|ZASAT10|ZASAT11|ZASUN1|ZASUN2|ZASUN3|ZASUN4|ZASUN5|ZASUN6|ZASUN7|ZASUN8|ZASUN9|ZASUN10|ZASUN11|ZAADV1|ZAADV2|ZAADV3|ZAADV4|ZAADV5|ZAADV6|ZAADV7|ZAADV8|ZAADV9|ZAADV10|ZAADV11|bkTotal|bkSaveExtras|bkSaveExtrasReason|bkSpecial_Instructions|bkInsertName_Rec|bkDate_Received|bkReceived_By|bkInsertCode_Rec|bkReceived_Quantity|bkPageCount_Rec|bkNotes|bkInsert_Image"
  WA_fieldValuesStr = "" & cStr(cStr(Request.Form("bkPublication"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkDate"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkSales_Person"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkCustomer"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkAccount_Code"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkInsertName"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkInsertCode"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkRun_Date"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkQuantity"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkPage_Count"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF1"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF2"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF3"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF4"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF5"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF6"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF7"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF8"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF9"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF10"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZATF11"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT1"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT2"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT3"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT4"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT5"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT6"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT7"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT8"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT9"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT10"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASAT11"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN1"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN2"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN3"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN4"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN5"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN6"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN7"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN8"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN9"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN10"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZASUN11"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV1"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV2"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV3"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV4"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV5"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV6"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV7"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV8"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV9"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV10"))) & "" & "|" & "" & cStr(cStr(Request.Form("ZAADV11"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkTotal"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkSaveExtras"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkSaveExtrasReason"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkSpecial_Instructions"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkInsertName_Rec"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkDate_Received"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkReceived_By"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkInsertCode_Rec"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkReceived_Quantity"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkPageCount_Rec"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkNotes"))) & "" & "|" & "" & cStr(cStr(Request.Form("bkInsert_Image"))) & ""
  WA_columnTypesStr = "',none,''|',none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,NULL|none,none,NULL|',none,''|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,'Y','N'|none,none,NULL|none,'Y','N'|',none,''|',none,''|',none,''|',none,NULL|',none,''|',none,''|none,none,NULL|none,none,NULL|',none,''|',none,''"
  WA_comparisonStr = " LIKE | = | LIKE | LIKE | LIKE | LIKE | LIKE | = | = | LIKE | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | LIKE | LIKE | LIKE | = | LIKE | LIKE | = | = | LIKE | LIKE "
  WA_fieldNames = Split(WA_fieldNamesStr,"|")
  WA_fieldValues = Split(WA_fieldValuesStr,"|")
  WA_columns = Split(WA_columnTypesStr,"|")
  WA_comparisions = Split(WA_comparisonStr, "|")

  insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
  set MM_editCmd = Server.CreateObject("ADODB.Command")
  MM_editCmd.ActiveConnection = WA_connection
  MM_editCmd.CommandText = "INSERT INTO " & WA_table & " (" & insertParamsObj(1) & ") VALUES (" & insertParamsObj(2) & ")"
  MM_editCmd.Execute()
  MM_editCmd.ActiveConnection.Close()
  obj = WA_AB_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues, WA_comparisions)
  sqlstr = "SELECT " & WA_indexField & " FROM " & WA_table & " WHERE " &  obj & " ORDER BY " & WA_indexField & " DESC"
  set WA_AppBuilderRecordset = Server.CreateObject("ADODB.Recordset")
  WA_AppBuilderRecordset.ActiveConnection = WA_connection
  WA_AppBuilderRecordset.Source = sqlstr
  WA_AppBuilderRecordset.CursorType = 0
  WA_AppBuilderRecordset.CursorLocation = 2
  WA_AppBuilderRecordset.LockType = 1
  WA_AppBuilderRecordset.Open()
  if (NOT WA_AppBuilderRecordset.EOF)  then  Session(WA_sessionName) = WA_AppBuilderRecordset.Fields.Item(WA_indexField).Value
  WA_AppBuilderRecordset.Close()
  if (WA_redirectURL <> "")  then
    if (WA_keepQueryString AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
      if (inStr(WA_redirectURL,"?") > 0)  then
        WA_redirectURL = WA_redirectURL & "&"
      else
        WA_redirectURL = WA_redirectURL & "?"
      end if
      WA_redirectURL = WA_redirectURL & Request.QueryString
    end if
    Response.Redirect(WA_redirectURL)
  end if
end if
%>
<%
Session.LCID = 1053
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<script type="text/javascript">
function calculate() {
var elems = document.forms['WADAInsertForm'].elements;
var total = 0;
for(var i=0;i<elems.length;i++) {
if (elems[i].checked) {total += +(elems[i].value);}
}
elems['bkTotal'].value = total;
}
</script>
<html><!-- InstanceBegin template="/Templates/maintemp.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Insert ames_booked</title>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="head" -->
<link href="../WA_DataAssist/styles/Refined_Slate.css" rel="stylesheet" type="text/css" />
<link href="../WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style></head>

<body>
<table width="728" align="center">
  <tr>
    <td width="720" scope="col"><p><img src="../Assets/INSERT_TRACKER_MAST.jpg" width="720" height="180"></p>
      <!-- InstanceBeginEditable name="body" --><div align="left"></div>
      
      <div class="WADAInsertContainer">
        <form action="ames_booked_Insert.asp" method="post" name="WADAInsertForm" id="WADAInsertForm">
          <div class="WADAHeader">Insert Record</div>
          <div class="WADAHorizLine"><img src="../WA_DataAssist/images/Slate/Refined_tx.gif" alt="" height="1" width="1" border="0" /></div>
          <table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
            <tr>
              <th width="167" class="WADADataTableHeader">Publication:</th>
              <td width="403" class="WADADataTableCell">                <select name="bkPublication" id="bkPublication">
                  <option value="value">Select A Publication</option>
                  <%
While (NOT rsAccount.EOF)
%>
                  <option value="<%=(rsAccount.Fields.Item("pubName").Value)%>"><%=(rsAccount.Fields.Item("pubName").Value)%></option>
                  <%
  rsAccount.MoveNext()
Wend
If (rsAccount.CursorType > 0) Then
  rsAccount.MoveFirst
Else
  rsAccount.Requery
End If
%>
                </select></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">bkDate:</th>
              <td class="WADADataTableCell"><input type="text" name="bkDate" id="bkDate" value="<%=date()%>" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Sales Person:</th>
              <td class="WADADataTableCell"><input type="text" name="bkSales_Person" id="bkSales_Person" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Customer:</th>
              <td class="WADADataTableCell"><input type="text" name="bkCustomer" id="bkCustomer" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Account Code:</th>
              <td class="WADADataTableCell"><input type="text" name="bkAccount_Code" id="bkAccount_Code" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Insert Name:</th>
              <td class="WADADataTableCell"><input type="text" name="bkInsertName" id="bkInsertName" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Insert Code:</th>
              <td class="WADADataTableCell"><input type="text" name="bkInsertCode" id="bkInsertCode" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Run Date:</th>
              <td class="WADADataTableCell"><input type="text" name="bkRun_Date" id="bkRun_Date" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Quantity:</th>
              <td class="WADADataTableCell"><input type="text" name="bkQuantity" id="bkQuantity" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Page Count:</th>
              <td class="WADADataTableCell"><input type="text" name="bkPage_Count" id="bkPage_Count" value="" size="32" /></td>
            </tr>
            <tr>
              <th colspan="2" class="WADADataTableHeader"><p>&nbsp;</p>
                <table width="400" align="center">
                  <tr bgcolor="#000000">
                    <th colspan="6" scope="col"><div align="center" class="style1">Zones For Ames Tribune/Tuesday-Friday </div></th>
                  </tr>
                  <tr>
                    <td width="73" align="right"><div align="right">Zone 1:<span class="WADADataTableCell"></span></div></td>
                    <td width="42"><div align="left"><span class="WADADataTableCell"><input type="checkbox" name="ZATF1" id="ZATF1" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td width="73"><div align="right">Zone 5:</div></td>
                    <td width="42">
                      <div align="left">
                        <input type="checkbox" name="ZATF5" id="ZATF5" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                    <td width="86"><div align="right">Zone 9:</div></td>
                    <td width="44">
                      <div align="left">
                        <input type="checkbox" name="ZATF9" id="ZATF9" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 2: </div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF2" id="ZATF2" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                    <td><div align="right">Zone 6:</div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF6" id="ZATF6" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                    <td><div align="right">Zone 10:</div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF10" id="ZATF10" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 3: </div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF3" id="ZATF3" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                    <td><div align="right">Zone 7:</div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF7" id="ZATF7" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                    <td><div align="right">Zone 11:</div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF11" id="ZATF11" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 4:</div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF4" id="ZATF4" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                    <td><div align="right">Zone 8:</div></td>
                    <td>
                      <div align="left">
                        <input type="checkbox" name="ZATF8" id="ZATF8" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                      </div></td>
                    <td><div align="right"></div></td>
                    <td><div align="left"></div></td>
                  </tr>
                </table>                
                <table width="400" align="center">
                  <tr bgcolor="#000000">
                    <th colspan="6" scope="col"><div align="center"><span class="style1">Zones For Ames Tribune /Saturday</span></div></th>
                  </tr>
                  <tr>
                    <td width="73"><div align="right">Zone 1:</div></td>
                    <td width="42"><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT1" id="ZASAT1" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td width="73"><div align="right">Zone 5:</div></td>
                    <td width="42"><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT5" id="ZASAT5" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td width="86"><div align="right">Zone 9:</div></td>
                    <td width="44"><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT9" id="ZASAT9" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 2:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT2" id="ZASAT2" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 6:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT6" id="ZASAT6" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 10:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT10" id="ZASAT10" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 3:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT3" id="ZASAT3" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 7:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT7" id="ZASAT7" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 11:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT11" id="ZASAT11" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 4:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT4" id="ZASAT4" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 8:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASAT8" id="ZASAT8" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right"></div></td>
                    <td><div align="left"></div></td>
                  </tr>
                </table>
                <table width="400" align="center">
                  <tr bgcolor="#000000">
                    <th colspan="6" scope="col"><div align="center"><span class="style1">Zones For Ames Tribune/Sunday </span></div></th>
                  </tr>
                  <tr>
                    <td width="73"><div align="right">Zone 1:</div></td>
                    <td width="42"><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN1" id="ZASUN1" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td width="73"><div align="right">Zone 5:</div></td>
                    <td width="42"><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN5" id="ZASUN5" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td width="86"><div align="right">Zone 9:</div></td>
                    <td width="44"><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN9" id="ZASUN9" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 2:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN2" id="ZASUN2" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 6:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN6" id="ZASUN6" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 10:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN10" id="ZASUN10" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 3:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN3" id="ZASUN3" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 7:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN7" id="ZASUN7" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 11:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN11" id="ZASUN11" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 4:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN4" id="ZASUN4" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 8:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZASUN8" id="ZASUN8" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right"></div></td>
                    <td><div align="left"></div></td>
                  </tr>
                </table>
                <table width="400" align="center">
                  <tr bgcolor="#000000">
                    <th colspan="6" scope="col"><div align="center"><span class="style1">Zones For Ames Advertiser </span></div></th>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 1:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV1" id="ZAADV1" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 5:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV5" id="ZAADV5" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 9:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV9" id="ZAADV9" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 2:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV2" id="ZAADV2" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 6:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV6" id="ZAADV6" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 10:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV10" id="ZAADV10" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 3:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV3" id="ZAADV3" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 7:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV7" id="ZAADV7" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 11:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV11" id="ZAADV11" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                  </tr>
                  <tr>
                    <td><div align="right">Zone 4:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV4" id="ZAADV4" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right">Zone 8:</div></td>
                    <td><div align="left"><span class="WADADataTableCell">
                        <input type="checkbox" name="ZAADV8" id="ZAADV8" onclick="calculate()" value="<%=(rsZones.Fields.Item("zQuantity").Value)%>"/>
                    </span></div></td>
                    <td><div align="right"></div></td>
                    <td><div align="left"></div></td>
                  </tr>
                </table>                
              </th>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Total:</th>
              <td class="WADADataTableCell"><input type="text" name="bkTotal" id="bkTotal" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Save Extras:</th>
              <td class="WADADataTableCell"><input type="checkbox" name="bkSaveExtras" id="bkSaveExtras" value="1" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Save Extras Reason:</th>
              <td class="WADADataTableCell"><input type="text" name="bkSaveExtrasReason" id="bkSaveExtrasReason" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Special Instructions:</th>
              <td class="WADADataTableCell"><input type="text" name="bkSpecial_Instructions" id="bkSpecial_Instructions" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Insert Name:</th>
              <td class="WADADataTableCell"><input type="text" name="bkInsertName_Rec" id="bkInsertName_Rec" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Date Received:</th>
              <td class="WADADataTableCell"><input type="text" name="bkDate_Received" id="bkDate_Received" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Received By:</th>
              <td class="WADADataTableCell"><input type="text" name="bkReceived_By" id="bkReceived_By" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Insert Code:</th>
              <td class="WADADataTableCell"><input type="text" name="bkInsertCode_Rec" id="bkInsertCode_Rec" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Received Quantity:</th>
              <td class="WADADataTableCell"><input type="text" name="bkReceived_Quantity" id="bkReceived_Quantity" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Page Count:</th>
              <td class="WADADataTableCell"><input type="text" name="bkPageCount_Rec" id="bkPageCount_Rec" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Notes:</th>
              <td class="WADADataTableCell"><input type="text" name="bkNotes" id="bkNotes" value="" size="32" /></td>
            </tr>
            <tr>
              <th class="WADADataTableHeader">Insert Image:</th>
              <td class="WADADataTableCell"><input type="text" name="bkInsert_Image" id="bkInsert_Image" value="" size="32" /></td>
            </tr>
          </table>
          <div class="WADAHorizLine"><img src="../WA_DataAssist/images/Slate/Refined_tx.gif" alt="" height="1" width="1" border="0" /></div>
          <div class="WADAButtonRow">
            <table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" hspace="0" vspace="0" border="0" name="Insert" id="Insert" value="Insert" alt="Insert" src="../WA_DataAssist/images/Slate/Refined_insert.gif"  /></td>
                <td class="WADADataNavButtonCell" nowrap="nowrap"><a href="ames_booked_Results.asp"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../WA_DataAssist/images/Slate/Refined_cancel.gif" /></a></td>
              </tr>
            </table>
            <input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="">
          </div>
        </form>
      </div>
      <!-- InstanceEndEditable -->
      <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p></td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
<%
rsAccount.Close()
Set rsAccount = Nothing
%>
<%
rsZones.Close()
Set rsZones = Nothing
%>

thanks, jay
 
Well your code does actually execute a rs.MoveFirst() BEFORE it loops through the code to create the checkboxes.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top