Solved

is there a function similar to a dateadd() in JS?

Posted on 2002-04-08
15
494 Views
Last Modified: 2012-05-04

first and fore most I will add more points to this question once my account gets reset thanks..
I was wondering if there is such a thing as a dateAdd() function like in sql or Coldfusion but in Js.


I have been trying to code something rather complicated for a while now and have been rather unsuccessfull.what I am trying to do is the following:

I have 3 date fields

1.  contract date(anchor for all other dates)
2.  payment in full Date
3.  deposit date

ok.?

now the contract date is user inputed

**the paymentinfull date is 35  days from contractdate**

the deposit date is also 35 days from the contract date.

I have however been trying to add this functionality into the following code and have had no luck.

the following code is just assigning different date spans based on current month.

function formatDate(date) {
var d  = date.getDate(); // set the need by date time frame
var day = (d < 10) ? '0' + d: d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var dateStr = month + "/" + day + "/" + year;
return dateStr;
}




var today = new Date();
  var dayow=today.getDay()
moy=today.getMonth()
modif=2
if(moy<=9)
{
modif=35
}
if(moy==10)
{
modif=15
}
anotherDay= new Date();
DueBy=anotherDay.getTime() + 1000*60*60*24*modif
anotherDay.setTime(DueBy)
esecs=today.getTime()
if(dayow>=0 && dayow<5)
{
esecs+=60*60*24*1000
}
else
{
mult=8-dayow
esecs+=mult*60*60*24*1000
}
today.setTime(esecs)

0
Comment
Question by:jriver12
  • 7
  • 5
  • 2
  • +1
15 Comments
 
LVL 8

Accepted Solution

by:
bebonham earned 150 total points
ID: 6926354
there is now, in your new type DateEx



function DateEx(yy,mm,dd)
{
var x=new Date(yy,mm,dd);
x.addDays=dot;
return x;
}
function dot(days)
{
msecInDay=1000*60*60*24;
days=days*msecInDay
this.setTime(this.getTime()+days)
}


var adate = new DateEx("2002","02","29");
adate.addDays(10);


alert(adate)


enjoy.
Bob

0
 
LVL 5

Expert Comment

by:kcm76
ID: 6926605
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<script language="JavaScript">
var MINUTE = 60 * 1000
var HOUR = MINUTE * 60
var DAY = HOUR * 24
var WEEK = DAY * 7

function addDays(myDate,days) {
     days = parseInt(days);    
     var mDate = new Date(myDate);
     var dt = new Date(mDate.getTime() + days*DAY);    
     var st = (dt.getMonth()+1) + "/" + dt.getDate() + "/"  +  dt.getFullYear();    
     text2.value = st;    
}

function Add()
{
     addDays(text.value, text1.value);
}
</script>
<BODY>
<TABLE>
     <TR><TD>mm/dd/yyyy </TD>
          <TD><input type=text id=text maxlength=10 value="04/09/2002"></TD></TR>
     <TR><TD>enter days to be added </TD>
          <TD><input type=text id=text1 value="1"></TD></TR>
     <TR><TD COLSPAN=2><input type=button onclick="Add()" value="add"></TD></TR>
     <TR><TD>result</TD><TD><input type=text id=text2></TD></TR></TABLE>

</BODY>
</HTML>

*****************
KCM
*****************
0
 
LVL 5

Expert Comment

by:kcm76
ID: 6926630
0
 

Author Comment

by:jriver12
ID: 6927952
how would I combine this code:

var today = new Date();
 var dayow=today.getDay()
moy=today.getMonth()
modif=2
if(moy<=9)
{
modif=35
}
if(moy==10)
{
modif=15
}
anotherDay= new Date();
DueBy=anotherDay.getTime() + 1000*60*60*24*modif
anotherDay.setTime(DueBy)
esecs=today.getTime()
if(dayow>=0 && dayow<5)
{
esecs+=60*60*24*1000
}
else
{
mult=8-dayow
esecs+=mult*60*60*24*1000
}
today.setTime(esecs)

which as I previously stated changes the amount of days, like:

if month is september then the difference between lets say the contract date and the full payment date should be 35

now if the month is october thru november then the difference should be 15 days
 and
if the month is december  thru january
then the difference should be 2days

from february thru august we go back to 35 days from contract date.

if you would like to take a look at the form that processes this (.cfm) let me get a email address.

for I think the page is too huge to post here.  but if you prefer I will post it here.

thanks guys.
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6928606
function DateEx(yy,mm,dd)
{
if(yy>0){
var x=new Date(yy,mm,dd);
}
else
{
var x=new Date()
}
x.addDays=dot;
return x;
}
function dot(days)
{
msecInDay=1000*60*60*24;
days=days*msecInDay
this.setTime(this.getTime()+days)
}




var today = new DateEx();
moy=today.getMonth()
modif=2;
if(moy>1)
{
modif=35
}
if(moy>8)
{
modif=15;
}
if(moy>11)
{
modif=2
}
dueBy=new DateEx();
dueBy=today;
dueBy.addDays(modif);
alert(dueBy);
0
 

Author Comment

by:jriver12
ID: 6929175
bebonham,
thanks for the help,
I am having a hard time getting this to work with my script.

it still is not populating my fprdate or deposit date (depending on the criteria. i am going to post the page (against my better judgement because of the size and the sloppy coding) hopefully you can tell me what I am doing wrong.


function CheckForm(){
var bl = (document.boothinformation.BT_B1_Dim_1.value);
var bw = (document.boothinformation.BT_B1_Dim_2.value);
var columns = (document.boothinformation.BT_Post.value);
var ismember = (document.boothinformation.BT_Member.value);
var corners = (document.boothinformation.BT_Corners.value);
var deposit = (document.boothinformation.BT_Deposit.value);
var contractDate = (document.boothinformation.BT_ContractDate.value);
var compstate = (document.boothinformation.compstate.value);
var country = (document.boothinformation.country.value);
var cancelled = (document.boothinformation.BT_Cancelled.value);
var cancelledDate = (document.boothinformation.BT_CancelledDate.value);

var today = new Date();
  var dayow=today.getDay()
moy=today.getMonth()
modif=2
if(moy<=9)
{
modif=35
}
if(moy==10)
{
modif=15
}
anotherDay= new Date();
DueBy=anotherDay.getTime() + 1000*60*60*24*modif
anotherDay.setTime(DueBy)
esecs=today.getTime()
if(dayow>=0 && dayow<5)
{
esecs+=60*60*24*1000
}
else
{
mult=8-dayow
esecs+=mult*60*60*24*1000
}
today.setTime(esecs)



//does the arithmatic for the total sq ft.
///changed to "must have non zero value" (not a NAN either)
if((bl >0) && (bw >0) || columns>0){
     var columnsqft = (columns * 5);
   if(bl<1 || bw<1)
     {  var totalsqft = (document.boothinformation.BT_TotalSQFT.value - (columnsqft));
    }
    else     {
var totalsqft = ((bl*bw) - (columnsqft));    
}
     document.boothinformation.BT_TotalSQFT.value = totalsqft;
      }
    totalsqft=document.boothinformation.BT_TotalSQFT.value
      //calculates member and non member cost
     if ((ismember) == 1 && (compstate) == 'NA'){
          var totalcost = ((totalsqft * 9) + (corners * 200));
          var memdiscount = (totalsqft);
     }
    if ((ismember) == 1 && (compstate) != 'NA'){
        var totalcost = (0);
          var memdiscount = (totalsqft);
              }
                                       
     if ((ismember) == 0 && (compstate) == 'NA') {
          var totalcost = ((totalsqft * 10) + (corners * 200));
          var memdiscount = (0);
     }
         if ((ismember) == 0 && (compstate) != 'NA') {
         document.boothinformation.BT_FPR.value = (1);
       document.boothinformation.BT_FPRDate.value = (formatDate(anotherDay));
       document.boothinformation.BT_Deposit.value = (0);
         document.boothinformation.BT_DepositDate.value = ('');
       document.boothinformation.BT_TotalCost.value = (0);
            document.boothinformation.BT_MemberD.value = (0);
     }
      
        document.boothinformation.BT_TotalCost.value = totalcost;
     document.boothinformation.BT_MemberD.value = memdiscount;

      
      
      if ((totalsqft) >= 300  && (country) == ' USA' || (country) == 'CANADA'){
            document.boothinformation.BT_FPR.value = (0);
                document.boothinformation.BT_FPRDate.value = ('');
                   document.boothinformation.BT_Deposit.value = (  (totalcost) * .25);
                               document.boothinformation.BT_DepositDate.value = (formatDate(anotherDay));
     }
             
         if ((totalsqft) <= 299) {
         document.boothinformation.BT_FPR.value = (1);
       document.boothinformation.BT_FPRDate.value = (formatDate(anotherDay));
       document.boothinformation.BT_Deposit.value = (0);
         document.boothinformation.BT_DepositDate.value = ('');
     }
       if ((moy) >=8)
      
      {
         document.boothinformation.BT_FPR.value = (1);
       document.boothinformation.BT_FPRDate.value = (formatDate(anotherDay));
       document.boothinformation.BT_Deposit.value = (0);
         document.boothinformation.BT_DepositDate.value = ('');
     }
if ((cancelledDate == '') && (cancelled == 1)){ // checks to see if contract has been cancelled if
//so gives date of cancellation
md=new Date()
     document.boothinformation.BT_CancelledDate.value = (formatDate(md));
}
if (cancelled == 0){
     document.boothinformation.BT_CancelledDate.value = ('');
}

if ((ismember) == 1 && (compstate) == 'NA'){
          var totalcost = ((totalsqft * 9) + (corners * 200));
          var memdiscount = (totalsqft);
     }
     if ((ismember) == 1 && (compstate) != 'NA' && (bl) >= 0 && (bw) >= 0) {
         document.boothinformation.BT_FPR.value = (1);
       document.boothinformation.BT_FPRDate.value = (formatDate(anotherDay));
       document.boothinformation.BT_Deposit.value = (0);
         document.boothinformation.BT_DepositDate.value = ('');
       document.boothinformation.BT_TotalCost.value = (0);
            document.boothinformation.BT_MemberD.value = (0);
     }
                                       
     if ((ismember) == 0 && (compstate) == 'NA') {
          var totalcost = ((totalsqft * 10) + (corners * 200));
          var memdiscount = (0);
     }
         if ((ismember) == 0 && (compstate) != 'NA' && (bl) >= 0 && (bw) >= 0) {
         document.boothinformation.BT_FPR.value = (1);
       document.boothinformation.BT_FPRDate.value = (formatDate(anotherDay));
       document.boothinformation.BT_Deposit.value = (0);
         document.boothinformation.BT_DepositDate.value = ('');
       document.boothinformation.BT_TotalCost.value = (0);
            document.boothinformation.BT_MemberD.value = (0);
     }
      
        document.boothinformation.BT_TotalCost.value = totalcost;
     document.boothinformation.BT_MemberD.value = memdiscount;



}

-->
</SCRIPT>

thanks again
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6929254
please post the html in the page as well.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:jriver12
ID: 6929443
going from I left off <SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var n = "";
function validate(input) {
if (input.length == 0) {
alert ('Please Enter A Number.');
document.boothinformation.textver.value = "";
return true;
}
else convert(input);
}
function d1(x) { // single digit terms
switch(x) {
case '0': n= ""; break;
case '1': n= " One "; break;
case '2': n= " Two "; break;
case '3': n= " Three "; break;
case '4': n= " Four "; break;
case '5': n= " Five "; break;
case '6': n= " Six "; break;
case '7': n= " Seven "; break;
case '8': n= " Eight "; break;
case '9': n= " Nine "; break;
default: n = "Not a Number";
}
return n;
}
function d2(x) { // 10x digit terms
switch(x) {
case '0': n= ""; break;
case '1': n= ""; break;
case '2': n= " Twenty "; break;
case '3': n= " Thirty "; break;
case '4': n= " Forty "; break;
case '5': n= " Fifty "; break;
case '6': n= " Sixty "; break;
case '7': n= " Seventy "; break;
case '8': n= " Eighty "; break;
case '9': n= " Ninety "; break;
default: n = "Not a Number";
}
return n;
}
function d3(x) { // teen digit terms
switch(x) {
case '0': n= " Ten "; break;
case '1': n= " Eleven "; break;
case '2': n= " Twelve "; break;
case '3': n= " Thirteen "; break;
case '4': n= " Fourteen "; break;
case '5': n= " Fifteen "; break;
case '6': n= " Sixteen "; break;
case '7': n= " Seventeen "; break;
case '8': n= " Eighteen "; break;
case '9': n= " Nineteen "; break;
default: n=  "Not a Number";
}
return n;
}
function convert(input) {
var inputlength = input.length;
var x = 0;
var teen1 = "";
var teen2 = "";
var teen3 = "";
var numName = "";
var invalidNum = "";
var a1 = ""; // for insertion of million, thousand, hundred
var a2 = "";
var a3 = "";
var a4 = "";
var a5 = "";
digit = new Array(inputlength); // stores output
for (i = 0; i < inputlength; i++)  {
// puts digits into array
digit[inputlength - i] = input.charAt(i)};
store = new Array(9); // store output
for (i = 0; i < inputlength; i++) {
x= inputlength - i;
switch (x) { // assign text to each digit
case x=9: d1(digit[x]); store[x] = n; break;
case x=8: if (digit[x] == "1") {teen3 = "yes"}
          else {teen3 = ""}; d2(digit[x]); store[x] = n; break;
case x=7: if (teen3 == "yes") {teen3 = ""; d3(digit[x])}
          else {d1(digit[x])}; store[x] = n; break;
case x=6: d1(digit[x]); store[x] = n; break;
case x=5: if (digit[x] == "1") {teen2 = "yes"}
          else {teen2 = ""}; d2(digit[x]); store[x] = n; break;
case x=4: if (teen2 == "yes") {teen2 = ""; d3(digit[x])}    
          else {d1(digit[x])}; store[x] = n; break;
case x=3: d1(digit[x]); store[x] = n; break;
case x=2: if (digit[x] == "1") {teen1 = "yes"}
          else {teen1 = ""}; d2(digit[x]); store[x] = n; break;
case x=1: if (teen1 == "yes") {teen1 = "";d3(digit[x])}    
          else {d1(digit[x])}; store[x] = n; break;
}
if (store[x] == "Not a Number"){invalidNum = "yes"};
switch (inputlength){
case 1:   store[2] = "";
case 2:   store[3] = "";
case 3:   store[4] = "";
case 4:   store[5] = "";
case 5:   store[6] = "";
case 6:   store[7] = "";
case 7:   store[8] = "";
case 8:   store[9] = "";
}
if (store[9] != "") { a1 =" Hundred, "} else {a1 = ""};
if ((store[9] != "")||(store[8] != "")||(store[7] != ""))
{ a2 =" Million, "} else {a2 = ""};
if (store[6] != "") { a3 =" Hundred "} else {a3 = ""};
if ((store[6] != "")||(store[5] != "")||(store[4] != ""))
{ a4 =" Thousand, "} else {a4 = ""};
if (store[3] != "") { a5 =" Hundred "} else {a5 = ""};
}
// add up text, cancel if invalid input found
if (invalidNum == "yes"){numName = "Invalid Input"}
else {
numName =  store[9] + a1 + store[8] + store[7]
+ a2 + store[6] + a3 + store[5] + store[4]
+ a4 + store[3] + a5 + store[2] + store[1];
}
store[1] = ""; store[2] = ""; store[3] = "";
store[4] = ""; store[5] = ""; store[6] = "";
store[7] = ""; store[8] = ""; store[9] = "";
if (numName == ""){numName = "Zero"};
document.boothinformation.BT_textver.value = "$" + numName + " and 00/100 Dollars";
return true;
}
//  End -->
</SCRIPT>

 


<cfset pagecaption = "Please Update the Booth information on  Exhibitor Number <cfoutput>#exhibitornumber#</cfoutput>.">


<cfinclude template="../../htmlheader.cfm">


  <table width="100%">
  <tr>
    <td width="40"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif">
      <a href="../../index.cfm">Home</a> </font> </b></i></font></td>
    <td width="6"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif">|</font>
      </b></i></font></td>
    <td width="93"><i><b><a href="../../Exhibitor/process/Ex_update.cfm?exhibitornumber=<cfoutput>#exhibitornumber#</cfoutput>">
      <font face="Geneva, Arial, Helvetica, san-serif" size="2" color="###000000">Exhibitor
      Info</font></a></b></i></td>
    <td width="6"><i><b><font color="###000000" size="2"> | </font></b></i></td>
    <td width="124"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif"><a href="../../Booth/process/Bsearch.cfm?exhibitornumber=<cfoutput>#exhibitornumber#</cfoutput>">
      Update other Booth </a></font> </b></i></font></td>
    <td width="6"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif">|</font>
      </b></i></font></td>
    <td width="86"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif"><a href="../../Exhibitor/process/Ex_Ins.cfm">Add
      New Exh</a> </font></b></i></font></td>
    <td width="6"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif">|</font>
      </b></i></font></td>
    <td width="51"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif"><a href="#">Reports</a>
      </font> </b></i></font></td>
    <td width="6"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif">|</font>
      </b></i></font></td>
    <td width="147"> <font color="###000000" size="2"><i><b><font color="###000000" size="2"><i><b><a href="../../Payments/P_Default.cfm?exhibitornumber=<cfoutput>#exhibitornumber#</cfoutput>"><font face="Geneva, Arial, Helvetica, san-serif">Payments
      on this booth</font></a> </b></i></font><font face="Geneva, Arial, Helvetica, san-serif">
      </font></b></i></font></td>
    <td width="6"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif">|</font>
      </b></i></font></td>
    <td width="118"> <font color="###000000" size="2"><i><b><font face="Geneva, Arial, Helvetica, san-serif"><a href="#">Delete
      Records</a></font> </b></i></font></td>
  </tr>
</table>


<CFQUERY NAME="view_BT_ExNumber" DATASOURCE="exhibition">
SELECT      dbo.EXH_CONTACT_INFO.ExhibitorNumber,EX_COMP_TO, EX_Co_Name,EX_C_Country, dbo.Booth_Information.BoothRecordID, dbo.Booth_Information.BT_Booth1, dbo.Booth_Information.BT_ExhibitorNumber, dbo.Booth_Information.BT_ContractDate, dbo.Booth_Information.BT_ExhibitorNumber, dbo.Booth_Information.BT_TypeofBooth, dbo.Booth_Information.BT_Cancelled, dbo.Booth_Information.BT_CancelledDate, dbo.Booth_Information.BT_SpaceWanted, dbo.Booth_Information.BT_Member, dbo.Booth_Information.BT_FPR, dbo.Booth_Information.BT_FPRDate, dbo.Booth_Information.BT_MemberD, dbo.Booth_Information.BT_B1_Dim_1, dbo.Booth_Information.BT_B1_Dim_2, dbo.Booth_Information.BT_Corners, dbo.Booth_Information.BT_Post, dbo.Booth_Information.BT_totalSQFt, dbo.Booth_Information.BT_Totalcost, dbo.Booth_Information.BT_Textver, dbo.Booth_Information.BT_Deposit, dbo.Booth_Information.BT_DepositDate, dbo.Booth_Information.BT_Manual_Status, dbo.Booth_Information.BT_ManualDate, dbo.Booth_Information.BT_CD_Status, dbo.Booth_Information.BT_CD_Date
FROM         dbo.Booth_Information, dbo.EXH_CONTACT_INFO
WHERE       dbo.EXH_CONTACT_INFO.ExhibitorNumber = dbo.Booth_Information.BT_ExhibitorNumber AND
                   (dbo.EXH_CONTACT_INFO.ExhibitorNumber = '#exhibitornumber#')
</CFQUERY>





</HEAD>
   
<BODY bgcolor="#FFFFCC" text="###000000" link="#333333" vlink="#333333" alink="#333333" onLoad="CheckForm();return validate(document.boothinformation.BT_TotalCost.value)">
<cfheader name="Cache-control" value="no-store">
You are Updating booth information on <br>
<b>Exhibitor Number:</b>
<cfoutput query="view_bt_exnumber" group="boothrecordid" >#BT_exhibitorNumber#
  <br>
<b>Company Name:</b>  #EX_Co_Name#
<br>

<b>Comp or Trade Out Status:</b>  #EX_COMP_TO#
 
<form name="boothinformation" method="post" action="bt_upproc.cfm?exhibitornumber=<cfoutput>#exhibitornumber#</cfoutput>&Ex_co_name=<cfoutput>#view_bt_exnumber.ex_co_name#</cfoutput>">
<input type="hidden" Name="country" value="#EX_C_Country#">
 <input type="hidden" Name="boothrecordId" value="#boothrecordid#">
<input type="hidden"  Name="compstate" Value="#EX_COMP_TO#">
 <input type="hidden" Name="BT_exhibitornumber" value="#view_bt_exnumber.BT_exhibitornumber#">
 <input type="hidden" Name="EX_CO_Name" Value="#view_bt_exnumber.Ex_co_name#">
  <font color="##000000"> </font>
    <table border="0" cellspacing="2" cellpadding="2" bgcolor="##FFFFCC" align="center">
      <tr align="left" valign="top">
        <td colspan="6"> </td>
      </tr>
      <tr align="left" valign="top">
        <td height="23" bgcolor="##003366" colspan="6"><b><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="##000000"><font color="##FFFFFF">Contract
          Information</font></font> </b></td>
      </tr>
      <tr align="left" valign="top">
        <td height="23" width="194"><b><font face="Arial, Helvetica, sans-serif" size="3" color="##000000"><font size="2">Contract
          Date</font></font> </b></td>
        <td width="112"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_ContractDate" maxlength="10" size="10" onChange="CheckForm()" value="#dateformat(BT_ContractDate,"mm/dd/yy")#">
          </font></b></td>
        <td height="23" width="130"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font face="Arial, Helvetica, sans-serif" size="2">Contract
          Cancelled</font></font> </b></td>
        <td height="23" width="60"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <select name="BT_Cancelled" onChange="CheckForm()">
            <option value="1" #iif (view_bt_exnumber.BT_Cancelled EQ "1",De ('Selected'), DE (''))#>Yes</option>
            <option value="0" #iif (view_bt_exnumber.BT_Cancelled EQ "0",De ('Selected'), DE (''))#>
            No</option>
          </select>
          </font></b></td>
        <td height="23" width="101"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">Cancelled
          Date</font></font> </b></td>
        <td height="23" width="114"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_CancelledDate" maxlength="10" size="10" onChange="CheckForm()" value="#dateformat(BT_CancelledDate,"mm/dd/yy")#">
          </font></b></td>
      </tr>
      <tr align="left" valign="top">
        <td height="23" colspan="6" bgcolor="##003366"> <b> <font face="Geneva, Arial, Helvetica, san-serif" size="2" color="##000000"><font color="##FFFFFF">Booth
          Information</font></font> </b></td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font face="Arial, Helvetica, sans-serif" size="2">Type
          of Booth</font></font> </b></td>
        <td width="112"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <select name="BT_TypeofBooth" onChange="CheckForm()" value="#view_bt_exnumber.bt_typeofbooth#">
           <option value="Commercial" #iif (view_bt_exnumber.bt_typeofbooth EQ "Commercial", DE('Selected'), DE(''))#>Commercial Egg</option>
                <option value="Processing" #iif (view_bt_exnumber.bt_typeofbooth EQ "Processing", DE('Selected'), DE(''))#>Processing</option>
            <option value="Production" #iif (view_bt_exnumber.bt_typeofbooth EQ "production", DE('Selected'), DE(''))#>Production</option>
            <option value="Both" #iif (view_bt_exnumber.bt_typeofbooth EQ "Both", DE('Selected'), DE(''))#>Both</option>
            <option value="Other" #iif (view_bt_exnumber.bt_typeofbooth EQ "other", DE('Selected'), DE(''))#>other</option>
          </select>
          </font> </b></td>
        <td width="130"> <b><font size="1"><font face="Arial, Helvetica, sans-serif" size="2">Booth
          Number </font></font></b></td>
        <td width="60"> <b>
          <input name="BT_Booth1" maxlength="4" size="4" value="#BT_Booth1#">
          </b></td>
        <td width="101"> <b><font face="Arial, Helvetica, sans-serif" size="2" color="##000000">Space
          Wanted</font> </b></td>
        <td width="114"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input maxlength="40" name="BT_spacewanted" size="8" value="#BT_spacewanted#">
          </font> </b></td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Arial, Helvetica, sans-serif" size="2" color="##000000">Booth
          Length</font> </b></td>
        <td width="112"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_B1_Dim_1" maxlength="8" size="8" onChange="CheckForm()" onFocus="return validate(document.boothinformation.BT_TotalCost.value)" value="#BT_B1_dim_1#">
          </font> </b></td>
        <td width="130"> <b><font face="Arial, Helvetica, sans-serif" size="2" color="##000000">Booth
          Width</font> </b></td>
        <td width="60"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_B1_Dim_2" maxlength="8" size="8" onChange="CheckForm()" onFocus="return validate(document.boothinformation.BT_TotalCost.value)" value="#BT_B1_dim_2#">
          </font> </b></td>
        <td width="101"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">Corners</font></font>
          </b></td>
        <td width="114"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_Corners" maxlength="4" size="4" value="#BT_Corners#" onChange="CheckForm()" onFocus="return validate(document.boothinformation.BT_TotalCost.value)">
          </font> </b></td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font face="Arial, Helvetica, sans-serif" size="2">Post</font></font>
          </b></td>
        <td width="112"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_Post" maxlength="4" size="4" value="#BT_Post#" onChange="CheckForm()" onFocus="return validate(document.boothinformation.BT_TotalCost.value)">
          </font> </b></td>
        <td width="130"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">Member</font></font>
          </b></td>
        <td width="60"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <select name="BT_Member"  onChange="CheckForm()" onBLUR="return validate(document.boothinformation.BT_TotalCost.value)">
            <option value="1" #iif (view_bt_exnumber.BT_Member EQ "1",De ('Selected'), DE (''))#>YES</option>
            <option value="0" #iif (view_bt_exnumber.BT_Member EQ "0",De ('Selected'), DE (''))#>NO</option>
          </select>
          </font> </b></td>
        <td width="101"><b></b> </td>
        <td width="114"><b></b> </td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Arial, Helvetica, sans-serif" size="2" color="##000000">Full
          Payment Required</font> </b></td>
        <td width="112"> <b><font color="##000000">
             <select  name="BT_FPR" maxlength="1" value="#bt_fpr#">
        <option value="1"<cfif view_bt_exnumber.BT_FPR eq "1"> selected</cfif>>Yes</option>
   <option value="0"<cfif view_bt_exnumber.BT_FPR eq "0"> selected</cfif>>No</option>
</select>
            <!--- for testing only
            <input type="text" value="#BT_FPR#"> --->
            
      
          </font></b></td>
        <td width="130"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">Full
          Payment Due Date</font></font> </b></td>
        <td width="60"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_FPRDate" maxlength="10" size="10"  value="#dateformat(BT_FPRDate,"mm/DD/YYYY")#">
          </font> </b></td>
        <td width="101"><b></b> </td>
        <td width="114"><b></b> </td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font face="Arial, Helvetica, sans-serif" size="2">Deposit
          Amount</font></font> <font face="Arial, Helvetica, sans-serif" size="2"><font color="##000000">Required</font>
          </font> </b></td>
        <td width="112"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_Deposit" maxlength="8" size="8" onChange="CheckForm()" value="#BT_Deposit#">
          </font> </b></td>
        <td width="130"> <b><font face="Arial, Helvetica, sans-serif" size="2" color="##000000">Deposit
          Due Date</font> </b></td>
        <td width="60"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_DepositDate" maxlength="10" size="10" onChange="CheckForm()" value="#dateformat(BT_DepositDate,"MM/DD/YYYY")#">
          </font> </b></td>
        <td width="101"><b></b> </td>
        <td width="114"><b></b> </td>
      </tr>
      <tr align="left" valign="top">
        <td height="25" colspan="4" bgcolor="##003366"> <b><font color="##000000" size="2"><font face="Arial, Helvetica, sans-serif" color="##FFFFFF">Contract
          words:</font></font> </b></td>
        <td width="101" height="25"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font face="Arial, Helvetica, sans-serif" size="2">Total
          Sq Ft</font></font> </b></td>
        <td width="114" height="25"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          &nbsp; &nbsp;
          <input name="BT_TotalSQFT" maxlength="8" size="8" onChange="CheckForm()" value="#BT_TotalSQFT#" >
          Sq Ft</font> </b></td>
      </tr>
      <tr align="left" valign="top">
        <td height="33" colspan="4"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_textver" maxlength="60" size="60" onChange="CheckForm()" onFocus="return validate(document.boothinformation.BT_TotalCost.value)" value="#BT_textver#">
          </font> </b></td>
        <td width="101" height="33"> <b><font face="Arial, Helvetica, sans-serif" size="2" color="##000000">Member
          Discount</font> </b></td>
        <td width="114" height="33"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <font size="3">$</font>
          <input name="BT_MemberD" maxlength="8" size="8" onChange="CheckForm()" onFocus="return validate(document.boothinformation.BT_TotalCost.value)" value="#BT_MemberD#">
          </font> </b></td>
      </tr>
      <tr align="left" valign="top">
        <td height="18" colspan="4"><b></b></td>
        <td height="24" width="101"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">Total
          Cost</font></font></b></td>
        <td height="24" width="114"><b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="3">$</font>
          <input name="BT_TotalCost" maxlength="8" size="8" onChange="CheckForm()" onFocus="return validate(document.boothinformation.BT_TotalCost.value)" value="#decimalformat(BT_TotalCost)#">
          </font></b></td>
      </tr>
      <tr align="left" valign="top">
        <td height="18" colspan="6" bgcolor="##003366"> <b><font color="##000000" face="Geneva, Arial, Helvetica, san-serif" size="2">
          <font color="##FFFFFF">Materials Requested</font></font> </b></td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">CD
          Requested</font></font> </b></td>
        <td width="112"> <b><font color="##000000">
          <select name="bt_CD_Status" value="#view_bt_exnumber.bt_CD_Status#">
            <option value="1" #iif (view_bt_exnumber.bt_CD_Status EQ "1",De ('Selected'), DE (''))#>Yes</option>
            <option value="0" #iif (view_bt_exnumber.bt_CD_Status EQ "1",De ('Selected'), DE (''))#>No</option>
          </select>
          </font></b></td>
        <td width="130"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font face="Arial, Helvetica, sans-serif" size="2">CD
          Sent Date</font></font> </b></td>
        <td width="60"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_cd_Date" maxlength="10" size="10" onChange="CheckForm()"Value="#dateformat(BT_cd_Date,"mm/dd/yy")#">
          </font> </b></td>
        <td width="101"><b></b> </td>
        <td width="114"><b></b> </td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">Manual
          Requested</font></font> </b></td>
        <td width="112"> <b><font color="##000000">
          <select name="bt_Manual_Status" value="#view_bt_exnumber.bt_Manual_Status#">
            <option value="1" #iif (view_bt_exnumber.bt_Manual_Status EQ "1",De ('Selected'), DE (''))#>Yes</option>
            <option value="0" #iif (view_bt_exnumber.bt_Manual_Status EQ "1",De ('Selected'), DE (''))#>No</option>
          </select>
          </font></b></td>
        <td width="130"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000"><font size="2" face="Arial, Helvetica, sans-serif">Manual
          Sent Date</font></font> </b></td>
        <td width="60"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="1" color="##000000">
          <input name="BT_ManualDate" maxlength="10" size="10" onChange="CheckForm()" Value="#dateformat(BT_ManualDate,"mm/dd/yy")#">
          </font> </b></td>
        <td width="101"><b></b> </td>
        <td width="114"><b></b> </td>
      </tr>
      <tr align="left" valign="top">
        <td width="194"> <b><font face="Geneva, Arial, Helvetica, san-serif" size="2" color="##000000">
          </font></b></td>
        <td width="112"><b></b> </td>
        <td width="130"><b></b> </td>
        <td width="60"><b></b> </td>
        <td width="101"><b></b> </td>
        <td width="114"><b></b> </td>
      </tr>
      <tr align="center" valign="top">
        <td colspan="6" height="2"> <font color="##000000">
          <input type="submit" name="Submit" value="Update Record">
          </font></td>
      </tr>
    </table>
</form>
</cfoutput>
<cfinclude template="../../htmlfooter.cfm">



   </BODY>
</HTML>
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6929560
thanks I am trying
0
 

Author Comment

by:jriver12
ID: 6929564
thanks
0
 

Author Comment

by:jriver12
ID: 6950966
bebonham

have you had any luck,?

I've hit a brick wall!
0
 

Author Comment

by:jriver12
ID: 6984739
this must be real difficult if it has been this long.

I have not had any luck on my end.

if I could only get it to read off of my contract date and then perform the date calculations that I already have in the above code....
0
 

Author Comment

by:jriver12
ID: 7043091
sorry I lost track of what I had open.
thanks for the solution.
0
 
LVL 1

Expert Comment

by:Quintin79
ID: 8644807
BEBONHAM,

im wondering what happens if you want to add 50 days or if your addition carries you into the next month...  I dont see any consideration here for leap years or months with 29,30 or 31 days.  Or is there that i just cant see?

0
 
LVL 8

Expert Comment

by:bebonham
ID: 8644872
yes, it will work fine,


it converts the date into milliseconds since 1/1/1970 and then converts the # of days into milliseconds and adds them.  then setdate is going to convert those milliseconds into a date based again on 1/1/1970 and you will get the right answer, regardless of leap year, or anything.

Bob
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 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

14 Experts available now in Live!

Get 1:1 Help Now