Solved

Load values from SQL table onload?

Posted on 2006-07-10
5
381 Views
Last Modified: 2008-02-07
I have an asp that collects info and writes it to a SQL2000 DB. There are two fields that I would like to autopopulate upon the page loading. They are GOAL and EFT. I have them in a table name GOALS. What is the best way to go about pulling that table info into the two text boxes onload?

Thanks in advance!

Andrew
0
Comment
Question by:Ahelbling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 17076464
This is an ASP script right?
So in your ASP script, grab those two variables and replace them in your fields like:
<INPUT TYPE="text" NAME="EFT" VALUE="<%= RS.("EFT") %>">
<INPUT TYPE="text" NAME="GOAL" VALUE="<%= RS.("GOAL") %>">

You don't need any onload on this since your ASP script is writing the HTML page out.
0
 

Author Comment

by:Ahelbling
ID: 17076518
Actually the html table is already created with text boxes and everything nice and formatted how I want it. The problem I am having is that the variable is not being passed to the value of the input object. Problem is here:  value="<% =SalesGoal %>"

CODE:

<%
      Dim RepDate,StoreName,Goal,EFT

            RepDate = Request.Form("RepDate")
            StoreName = Request.Form("StoreName")
      
%>


<%
Sub PopulateGoal
 Dim objConn
 Dim objRS
 Dim strSQL
 Dim SalesGoal
 Dim EFTGoal

 Const adOpenForwardOnly = 0
 Const adLockReadOnly  = 1

 Set objConn = Server.CreateObject("ADODB.Connection")
 Set objRS  = Server.CreateObject("ADODB.Recordset")

      SalesGoal = 1
      
 objConn.Open "Provider=sqloledb;" & _
           "Data Source=database-server;" & _
           "Initial Catalog=CorpWeb;" & _
           "User Id=*****;" & _
           "Password=*****"

 strSQL = "SELECT * FROM NumbersGoals WHERE Location = 1"

 objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly

 Do Until objRS.EOF = True
  SalesGoal = 1
  EFTGoal = objRS("EFTGoal").Value

 objRS.Movenext
 Loop

 objRS.Close
 Set objRS = Nothing
 Set objConn = Nothing

End Sub
%>


<html>

<head>

<title>Nightly Store Numbers</title>

<script language="JavaScript1.2">
window.onload = window.resizeTo(1024,768);
</script>

<script>
function KeyPress()
{
//alert(window.event.keyCode)
if (window.event.keyCode == 13)
window.event.keyCode =0;
}
</script>


<SCRIPT>
function validate()

{
if (NightlyStoreNumbers.StoreName.options[0].selected) {
alert('Please select a Store.');
event.returnValue=false;
}

{
mNv=NightlyStoreNumbers.RepDate.value;
if (mNv=='') {
alert('A date is a required field. Please select one.');
event.returnValue=false;
}

{
mNv0=NightlyStoreNumbers.Goal.value;
if (mNv0=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv1=NightlyStoreNumbers.EFT.value;
if (mNv1=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv2=NightlyStoreNumbers.DSTotSales.value;
if (mNv2=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv3=NightlyStoreNumbers.DSSessions.value;
if (mNv3=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv4=NightlyStoreNumbers.DDTotSales.value;
if (mNv4=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv5=NightlyStoreNumbers.DDDraftDep.value;
if (mNv5=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv6=NightlyStoreNumbers.DDSalesTax.value;
if (mNv6=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv7=NightlyStoreNumbers.DDPaymentAcct.value;
if (mNv7=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv8=NightlyStoreNumbers.DDInHouse.value;
if (mNv8=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv9=NightlyStoreNumbers.DDGiftCerts.value;
if (mNv9=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv10=NightlyStoreNumbers.DDReturnEFT.value;
if (mNv10=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv11=NightlyStoreNumbers.DDProdSales.value;
if (mNv11=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv12=NightlyStoreNumbers.DDBonusBucks.value;
if (mNv12=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv13=NightlyStoreNumbers.DDPrepaidDlrs.value;
if (mNv13=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv14=NightlyStoreNumbers.DDMysticMem.value;
if (mNv14=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv15=NightlyStoreNumbers.DDBuyMem.value;
if (mNv15=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv16=NightlyStoreNumbers.DDMysticSales.value;
if (mNv16=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv17=NightlyStoreNumbers.DDMysticSess.value;
if (mNv17=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv18=NightlyStoreNumbers.DDNewClients.value;
if (mNv18=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv19=NightlyStoreNumbers.DDTotSess.value;
if (mNv19=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv20=NightlyStoreNumbers.SBCFreeze.value;
if (mNv20=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv21=NightlyStoreNumbers.SBCCanRegular.value;
if (mNv21=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv22=NightlyStoreNumbers.SBCCanMystTran.value;
if (mNv22=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv23=NightlyStoreNumbers.SBCCanEft.value;
if (mNv23=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv24=NightlyStoreNumbers.SBCCanTransfer.value;
if (mNv24=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv25=NightlyStoreNumbers.DaysMonth.value;
if (mNv25=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}

{
mNv26=NightlyStoreNumbers.DaysRemain.value;
if (mNv26=='') {
alert('All fields must be filled in.');
event.returnValue=false;
}


}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}




function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o";
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) {
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_changePropRestore() {//v1.0
 var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i];
 if(x.v=="") x.v=""; eval("x."+x.n+"=x.v"); } d.$cpe=null; }
}
</SCRIPT>



</head>

<body background="../../MetalNew1.jpg" bgproperties="fixed" onload="PopulateGoal()" onKeyPress="KeyPress()">

<div align="center"><font size="4"><strong><font color="#C58931" face="Tahoma">Nightly Store Numbers</font></strong></font></div>

<FORM method="POST" name="NightlyStoreNumbers" action="../NightlyStoreNumbers2.asp" onsubmit="validate();">
  <div align="center"><b><font face="Tahoma">Date:</font></b><font size="3" face="Tahoma"><b>
      </b>
    <input name="RepDate" title=" Report date "  size="10" value="<% =RepDate %>"readonly=true tabindex="1" style="text-align: Center; font-family: Tahoma"></font><font face="Tahoma"><b><a href="https://webapps.thetanco.com/tancoweb/scripts/AspDatepicker.asp?inField=NightlyStoreNumbers.RepDate" onLoad="self.focus()" onClick="window.open('https://webapps.thetanco.com/tancoweb/scripts/AspDatepicker.asp?inField=NightlyStoreNumbers.RepDate', 'MyWin', 'status=no,resizable=no,scrollbars=no,width=200,height=140,left=250,top=250'); return false"><img border="0" src="../../scripts/dynCalendar.gif" width="16" height="16"></a>
    </b>
    <font size="3"><b>&nbsp;&nbsp; Store:</font></td>    </b></font></font><font face="Tahoma"><b>
    <font size="3">
      <input name="StoreName" " value="<% =StoreName %>" size="25" style="text-align: Center; font-family: Tahoma" tabindex="4"</font></b></font></div>
      <div align="center">&nbsp;<center>
            <table border="0" width="38%" cellspacing="1">
                  <tr>
                        <td align="center" nowrap>
                        <p align="right"><b><font face="Tahoma">
                        Goal:</font></b></td>
                        <td align="center" nowrap><font face="Tahoma" size="3">
                        <input name="Goal" title=" Goal " value="<% =SalesGoal %>" size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="3" maxlength="12" style="float: right" style="float: right"></font></td>
                        <td width="46%" align="right" nowrap colspan="2">
                        <p align="center"><font face="Tahoma"><b>Department &amp; Division</b></font></td>
                        <tr>
                        <td align="center" nowrap>
                        <p align="right"><b><font face="Tahoma">
                        EFT:</font></b></td>
                        <td align="center" nowrap><font face="Tahoma" size="3">
                        <input name="EFT" title=" 90% of expected EFT " value=2 size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="4" maxlength="12" style="float: right" style="float: right"></font></td>
                        <td width="31%" align="right" nowrap>
                        <a ><font face="Tahoma">
                        Total Sales:</font></a><font face="Tahoma"></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                              <input type="text" name="DDTotSales" title=" Total sales without tax " title="Tooltip"  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="15" maxlength="12" style="float: right"></font></td>
                        <tr>
                        <td align="center" nowrap colspan="2">
                        &nbsp;</td>
                        <td width="31%" align="right" nowrap>
                        <font color="#000000" face="Tahoma">Draft Deposit:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                              <input type="text" name="DDDraftDep" title=" Department 21 "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="16"></font></td>
                        <tr>
                        <td align="center" nowrap colspan="2">
                        <p align="center"><font face="Tahoma"><b>Daily Sales</b></font></td>
                        <td width="31%" align="right" nowrap>
                        <font face="Tahoma">Sales Tax</font><font color="#000000" face="Tahoma">:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                              <input type="text" name="DDSalesTax" title=" Total sales tax "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="17"></font></td>
                        <tr>
                        <td align="right" nowrap><font face="Tahoma">Sales</font><font color="#000000" face="Tahoma">:</font></td>
                        <td align="right" nowrap>
                        <p align="center"><font face="Tahoma" size="3">
                              <input name="DSTotSales" title=" Total sales without tax "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="5" maxlength="12" style="float: right" style="float: right"></font></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Payment
                        on Account</font><font color="#000000" face="Tahoma">:</font></td>
                        <td width="19%" align="right" nowrap><font face="Tahoma" size="3">
                              <input type="text" name="DDPaymentAcct" title=" Department 28 "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="18"></font></td>
                        <tr>
                        <td width="35%" align="right" nowrap>
                        <font face="Tahoma">Sessions</font><font color="#000000" face="Tahoma">:</font></td>
                        <td>
                        <div align="center"><font face="Tahoma" size="3">
                              <input name="DSSessions" title=" # of tanning sessions "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="6" maxlength="12" style="float: right"></font></div></tr><font face="Tahoma">
        <center>
                        </font>
                        <td width="31%" align="right" nowrap>
                        <font color="#000000" face="Tahoma">In House Charge:</font></td>
                        <td width="19%" align="right" nowrap><font face="Tahoma" size="3">
                              <input type="text" name="DDInHouse" title=" Non Revenue "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="19"></font></td>
                        <tr>
                        <td width="35%" align="right" nowrap>
                        &nbsp;</td>
                        <td>
                        <div align="left"><font face="Tahoma" size="3">
                              &nbsp;</font></div></tr><font face="Tahoma">
        <center>
                        </font>
                        <td width="31%" align="right" nowrap>
                        <font color="#000000" face="Tahoma">Gift Certificates:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                              <input type="text" name="DDGiftCerts" title=" Non Revenue "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="20"></font></td>
                        <tr>
                        <td align="right" nowrap colspan="2">
                        <p align="center"><font face="Tahoma"><b>Sales by Code</b></font></td>
                        <td width="31%" align="right" nowrap>
                        <font color="#000000" face="Tahoma">Returned EFT:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                              <input type="text" name="DDReturnEFT" title=" Department 22 "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="21"></font></td>
                        <tr>
                        <td width="35%" align="right" nowrap><font face="Tahoma">Freeze:</font></td>
                        <td>
                        <div align="left"><font face="Tahoma" size="3">
                              <input type="text" name="SBCFreeze" title=" FV5,FW5,FM5,FE10,FES10 "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="7" maxlength="12" style="float: right"></font></div></tr><font face="Tahoma">
        <center>
                        </font>
                        <td width="31%" align="right" nowrap>
                        <font face="Tahoma">Product Sales:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDProdSales" title=" Division total "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="22"></font></td>
                        <tr>
                        <td width="35%" align="right" nowrap>
                        <font face="Tahoma">Cancel Regular:</font></td>
                        <td width="15%" align="left" nowrap>
                        <div align="left"><font face="Tahoma" size="3">
                              <input type="text" name="SBCCanRegular" title=" CV,CW,CE,CES "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="8" maxlength="12" style="float: right"></font></div></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Bonus
                        Bucks:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDBonusBucks" title=" Non Revenue "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="23"></font></td>
                  </tr>
                  <tr>
                        <td width="35%" align="right" nowrap><font face="Tahoma">Cancel
                        Freeze:</font></td>
                        <td width="15%" align="left" nowrap>
                        <div align="left"><font face="Tahoma" size="3">
                              <input type="text" name="SBCCanFreeze" title=" CF "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="9" maxlength="12" style="float: right"></font></div></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Prepaid
                        Dollars:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDPrepaidDlrs" title=" Non Revenue "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="24"></font></td>
                  </tr>
                  <tr>
                        <td width="35%" align="right" nowrap><font face="Tahoma">Cancel
                        Mystic/Transfer:</font></td>
                        <td width="15%" align="left" nowrap>
                        <div align="left"><font face="Tahoma" size="3">
                              <input type="text" name="SBCCanMystTran" title=" CM,CMTR "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="10" maxlength="12" style="float: right"></font></div></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Mystic
                        Memb:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDMysticMem" title=" Department 3 "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="25"></font></td>
                  </tr>
                  <tr>
                        <td width="35%" align="right" nowrap>
                        <font face="Tahoma">Cancel EFT:</font></td>
                        <td width="15%" align="left" nowrap>
                        <div align="left"><font face="Tahoma" size="3">
                              <input type="text" name="SBCCanEft" title=" Anything with EFT "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="11" maxlength="12" style="float: right"></font></div></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Buy Memb:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDBuyMem" title=" Department 2 "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="26"></font></td>
                  </tr>
                  <tr>
                        <td width="35%" align="right" nowrap>
                        <font face="Tahoma">Cancel Transfer:</font></td>
                        <td width="15%" align="left" nowrap>
                        <div align="left"><font face="Tahoma" size="3">
                              <input type="text" name="SBCCanTransfer" title=" CVTR,CWTR "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="12" maxlength="12" style="float: right"></font></div></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Mystic
                        Sales:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDMysticSales" title=" Department 5 + Department 12 "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="27"></font></td>
                  </tr>
                  <tr>
                        <td width="35%" align="right" nowrap>
                        &nbsp;</td>
                        <td width="15%" align="left" nowrap>
                        <div align="left"><font face="Tahoma" size="3">
                              &nbsp;</font></div></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Mystic
                        Sessions:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDMysticSess" title=" Department 12 (QTY) "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="28"></font></td>
                  </tr>
                  <tr>
                        <td width="35%" align="right" nowrap><b><font face="Tahoma">Days
                        in Month:</font></b></td>
                        <td width="15%" align="left" nowrap>
                        <font face="Tahoma" size="3">
                              <input name="DaysMonth" title=" # of days in current month "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="13" maxlength="12" style="float: right" style="float: right"></font></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">New
                        Clients:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDNewClients" title=" # of new clients "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="29"></font></td>
                  </tr>
                  <tr>
                        <td width="35%" align="right" nowrap><b><font face="Tahoma">Days
                        Remaining:</font></b></td>
                        <td width="15%" align="left" nowrap>
                        <font face="Tahoma" size="3">
                              <input name="DaysRemain" title=" # of days remaining in current month "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" tabindex="14" maxlength="12" style="float: right" style="float: right"></font></td>
                        <td width="31%" align="right" nowrap><font face="Tahoma">Total
                        Sessions:</font></td>
                        <td width="19%" align="right" nowrap>
                        <font face="Tahoma" size="3">
                        <input type="text" name="DDTotSess" title=" Total sessions "  size="10" style="text-align: Right; font-family: Tahoma" maxlength="12" style="float: right" maxlength="12" style="float: right" tabindex="30"></font></td>
                  </tr>
                  </table></center></div>
    <p align="center"><font face="Tahoma">
      <input type="submit" value="Submit" name="Submit" tabindex="32"></a>&nbsp;&nbsp;
     <input type="hidden" name="isSubmitted" value="yes">
      <input type="reset" value="Reset" name="Reset" tabindex="33"></font></p>
</form>
 
 
    <SCRIPT LANGUAGE="JavaScript">
 <!-- Begin
if (window.print) {
document.write('<form> '
+ '<p align="center"> <input type=button name=print tabindex=31 value="Print" '
+ 'onClick="javascript:window.print()"> </form>');
}
// End -->
    </script>

</body>

</html>
0
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 17076611
Seems fine, I don't recall if ASP will take <% = Field %> vs <%= Field %>

Change that in all 3 fields and see.

Also not that th einput tag has multiple style= blocks like:
style="float: right" style="float: right"

So if you view source on the rendered page, what do you see between value="" ?
0
 

Author Comment

by:Ahelbling
ID: 17076654
value="<% =StoreName %>" works on the rendered page - so that syntax doesnt seem to be the issue. I think it may be the scope of the variable for some reason.  As you can see in the PopulateGoal Sub, I am assigning a value to SalesGoal. But when I use that variable in the value for the input object, I get nothing. The others work that are being passed from the previous page, but the SQL results dont.
0
 
LVL 26

Accepted Solution

by:
DireOrbAnt earned 500 total points
ID: 17077622
You are right. The HTML is rendered outside of the proc.
Use Goal or another global Dim to put in there. So maybe stick:
Goal = SalesGoal
Just before "End Sub".

Then replace <%= SalesGoal %> with <%= Goal %>
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question