Solved

Load values from SQL table onload?

Posted on 2006-07-10
5
375 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
  • 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now