/    Sign up×
Community /Pin to ProfileBookmark

Text Object Value As Date

Hi.

I’v just started learning JS and have become quite interested. I’m created a calculator for my webpage. The calculator has a bunch of text objects, one option object.

There is one text object where the user keys a date, “some day in January”. 01/05/2006

I have a variable which equals a number say 15. I want to multiply 15*7 =105 and add that to the date in the text obect and place the new date in another text object called “cppLastFull.

so cppLastFull would = 04/20/2006

any help is great
thank you

to post a comment
JavaScript

32 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Mar 01.2006 — you want to do something like this

<i>
</i>var strField = document.formName.elementName.value;
var dObj = new Date(strField);
var intD = dObj.getDate();
var intMath = intD * 7;
dObj.setDate(intD + intMath);
alert(dObj.toString());


Some checks/validation is needed, but you can figure that out.

Eric
Copy linkTweet thisAlerts:
@James_GatkaMar 01.2006 — [CODE]<html>
<head>
<script type="text/javascript">

var fifteen = 15;
var mult = 7;

function validate(isField){

splitDate = isField.value.split("/");
refDate = new Date(isField.value);
if (splitDate[0] < 1 || splitDate[0] > 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2])))
{
alert('Invalid date');
isField.value = "";
isField.focus();
return false;
}
isField.value = isField.value.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
return refDate;
}

function calc(nForm){

var startDate = validate(nForm['useDate']);
if (startDate)
{
var adj = fifteen * mult;
var dateStr = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+adj);
var slashStr = dateStr.getMonth()+1+"/"+dateStr.getDate()+"/"+dateStr.getFullYear();
nForm['cppLastFull'].value = slashStr.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
}
}

</script>
</head>
<body>
<form>

Date: <input type='text' name='useDate' size='9' onblur="calc(this.form)">
<br>
cppLastFull: <input type='text' name='cppLastFull' size='9' readonly>


</form>

</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@kprocauthorMar 01.2006 — Hi Thank you for the help

I have been working with the script provided in the first post, its easy for me to understand. I think that its going to do what I need but I'm having a hard time making the adjustments.

The variable that I have set to multiply by 7 is cppN. I'm not shure where to reference this in. I tried changing th intD but no luck.

The format of the date based on the below is "Sun Jan 8 00:00:00 EST 2006"

is there a way to change this to mm/dd/yyyy

here is what I have this far

var strField = form.fPay.value;

var dObj = new Date(strField);

var intD = dObj.getDate();

var intMath = intD * 7;

dObj.setDate(intD + intMath);

alert(dObj.toString());


agian thank you for your help
Copy linkTweet thisAlerts:
@James_GatkaMar 01.2006 — My code uses the format, mm/dd/yyyy..........
Copy linkTweet thisAlerts:
@kprocauthorMar 01.2006 — James, thanks I'm trying to work your code into my project. cppFullDate is the location of where I want the new date to go. The first date is located in a text field called "fPay. "

the value 15 will change. I have a variable that will replace the number 15. the variable is cppN

I.E. fpay + (7*15) = cppFullDate

Thank you
Copy linkTweet thisAlerts:
@James_GatkaMar 01.2006 — It's difficult for me to understand you. I think that you meant to write that you changed the "name" of the initial date input field to " cppFullDate". Okay, I'll do the same in the following code, I'll also change the name of the result text box to "result", okay? Test the following as is, before you try to put it in your code, okay?


[CODE]<html>
<head>
<script type="text/javascript">

var fifteen = 15;
var mult = 7;

function validate(isField){

splitDate = isField.value.split("/");
refDate = new Date(isField.value);
if (splitDate[0] < 1 || splitDate[0] > 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2])))
{
alert('Invalid date');
isField.value = "";
isField.focus();
return false;
}
isField.value = isField.value.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
return refDate;
}

function calc(nForm){

var startDate = validate(nForm['cppLastFull']);
if (startDate)
{
var adj = fifteen * mult;
var dateStr = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+adj);
var slashStr = dateStr.getMonth()+1+"/"+dateStr.getDate()+"/"+dateStr.getFullYear();
nForm['result'].value = slashStr.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
}
}

</script>
</head>
<body>
<form>

cppLastFull: <input type='text' name='cppLastFull' size='9' onblur="calc(this.form)">
<br>
Result <input type='text' name='result' size='9' readonly>


</form>

</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@kprocauthorMar 01.2006 — Sorry about the bad typing in my last post, I was rushing. I edited my last post to better expalin what I'm having a hard time with.

thank you
Copy linkTweet thisAlerts:
@James_GatkaMar 01.2006 — I made the changes. Thank you for addressing me by name, I would do the same, but you don't have a "signature." It's a simple, but often ignored courtesy.

[CODE]<html>
<head>
<script type="text/javascript">

var cppN = 15;

function validate(isField){

splitDate = isField.value.split("/");
refDate = new Date(isField.value);
if (splitDate[0] < 1 || splitDate[0] > 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2])))
{
alert('Invalid date');
isField.value = "";
isField.focus();
return false;
}
isField.value = isField.value.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
return refDate;
}

function calc(nForm){

var startDate = validate(nForm['fPay']);
if (startDate)
{
var adj = cppN * 7;
var dateStr = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+adj);
var slashStr = dateStr.getMonth()+1+"/"+dateStr.getDate()+"/"+dateStr.getFullYear();
nForm['cppFullDate'].value = slashStr.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
}
}

</script>
</head>
<body>
<form>

fPay: <input type='text' name='fPay' size='9' onblur="calc(this.form)">
<br>
cppFullDate: <input type='text' name='cppFullDate' size='9' readonly>


</form>

</body>
</html>[/CODE]
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — Thank you for helping me through this.

below is the code that I have been trying to edit to make work, no look so far.

The variables fPay, cppN have values already assigned to them.

The code as passed below prodes nothing, no values or error messages


fpay + (7*cppN) = cppFullDate

The code below supposed to create a value for cppfullDate

[CODE]
var N = cppN;

function validate(isField){

splitDate = isField.value.split("/");
refDate = new Date(isField.value);
if (splitDate[0] < 1 || splitDate[0] > 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2])))
{
alert('Invalid date');
isField.value = "";
isField.focus();
return false;
}
isField.value = isField.value.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
return refDate;
}

function calc(nForm){

var startDate = validate(nForm['fPay']);
if (startDate)
{
var adj = N * 7;
var dateStr = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+adj);
var slashStr = dateStr.getMonth()+1+"/"+dateStr.getDate()+"/"+dateStr.getFullYear();
nForm['cppFullDate'].value = slashStr.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
}
}
[/CODE]
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — I figured my problem but having a hard time finding a solution. There is nothing in my project calling the function calc. asd I'm not using the form attached

my form has a button to generate results, I tried adding a second onclick to it but no luck.

any thoughts
Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — my form has a button to generate results, I tried adding a second onclick to it but no luck.[/QUOTE]
The two onclick events must be merged into one. Show your button with the two onclick events and I can fix it for you.
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — Hi below is all the code upto my form,

thank you for your help

<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;CPP &amp; EI Calculator&lt;/title&gt;
&lt;script language="Javascript" type="text/javascript"&gt;
&lt;!--
function compute(form){

var p = parseFloat(form.gross.value);
var n = parseInt(form.payF.value);

var pn =(p)/(n);
var pncpp=(p-3500)/(n)// 3500 = basic deduction

var cp = (Math.round((pncpp *0.0495)))// calculated Full CPP Deduction
var ei =(Math.round((pn *0.0195))) // Full EI Deduction

var cppN = (1910.70/(cp)) // calculates number of pays to max CPP
var cppF = (cppN) - Math.floor(cppN);
var eiN = (729.30/(ei)) // calculated number of EI pays to max
var eiF = (eiN)- Math.floor(eiN)
var eiL = Math.round(eiF * ei)
var cppL = Math.round(cppF * ei)

var nP = cppN;

<i> </i>function validate(isField){

<i> </i> splitDate = isField.value.split("/");
<i> </i> refDate = new Date(isField.value);
<i> </i> if (splitDate[0] &lt; 1 || splitDate[0] &gt; 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2])))
<i> </i> {
<i> </i> alert('Invalid date');
<i> </i> isField.value = "";
<i> </i> isField.focus();
<i> </i> return false;
<i> </i> }
<i> </i> isField.value = isField.value.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
<i> </i> return refDate;
<i> </i>}

<i> </i>function calc(nForm){

<i> </i> var startDate = validate(nForm['fPay']);
<i> </i> if (startDate)
<i> </i> {
<i> </i> var adj = nP * 7;
<i> </i> var dateStr = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+adj);
<i> </i> var slashStr = dateStr.getMonth()+1+"/"+dateStr.getDate()+"/"+dateStr.getFullYear();
<i> </i> nForm['cppFullDate'].value = slashStr.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
<i> </i> }
<i> </i>}

Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — Ya, but I need to see your button HTML with both onclick events coded in it. THis is so that I can see what you're doing with the returned value.
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — Hope this helps, thank you very much for all your help, you replied to my other post and it worked great

<input type="button" value="Calculate" onclick="compute(this.form)">
Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — I only see one onclick.
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — I'm confused

<input type="button" value="Calculate" onclick="compute(this.form) onclick="calc(thisform)">

This is what I tried but I get error message. does this help
Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — OK, I see a problem. You inserted those two new functions into the middle of your existing [b]compute[/b] function.
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — thoughts on how to fix it. thank you for your help
Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — The obvious answer is that you need to move them out of there. If you can't do that, then post your entire SCRIPT block and I'll fix it.
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — HI

Here is all the script for my project

Thank you

<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;CPP &amp; EI Calculator&lt;/title&gt;
&lt;script language="Javascript" type="text/javascript"&gt;
&lt;!--
function compute(form){

var p = parseFloat(form.gross.value);
var n = parseInt(form.payF.value);

var pn =(p)/(n);
var pncpp=(p-3500)/(n)// 3500 = basic deduction

var cp = (Math.round((pncpp *0.0495)))// calculated Full CPP Deduction
var ei =(Math.round((pn *0.0195))) // Full EI Deduction

var cppN = (1910.70/(cp)) // calculates number of pays to max CPP
var cppF = (cppN) - Math.floor(cppN);
var eiN = (729.30/(ei)) // calculated number of EI pays to max
var eiF = (eiN)- Math.floor(eiN)
var eiL = Math.round(eiF * ei)
var cppL = Math.round(cppF * ei)





if(isNaN(p)){
alert('Enter Gross Annual Pay');
form.gross.focus();
return;
}

if(isNaN(n)){

form.payF.focus();
return;
}

if((p-3500)*0.0495 &lt; 1910.70) {
alert('Will Not Reach CPP Max of $1910.70');
form.payF.focus();

}

if(p*0.0195 &lt; 729.30) {
alert('Will Not Reach EI Max of $729.30');
form.payF.focus();
return;
}
form.cppFull.value = (cp)
form.eiFull.value = (ei)
form.eiLast.value = (eiL)
form.cppLast.value = (cppL)


}

<i> </i>function validate(isField){

var nP = cppN;
var p = parseFloat(form.gross.value);
var n = parseInt(form.payF.value);

var pn =(p)/(n);
var pncpp=(p-3500)/(n)// 3500 = basic deduction

var cp = (Math.round((pncpp *0.0495)))// calculated Full CPP Deduction

var cppN = (1910.70/(cp)) // calculates number of pays to max CPP

var sel = document.forms[0].payF;
var d, opt = sel.options[sel.selectedIndex].value;
switch (opt) {
case "52": d = 7; break;
case "26": d = 14; break;
case "24": d = 15; break;
case "12": d = 30; break;
default: alert("Check Pay Frequency.");
}

<i> </i> splitDate = isField.value.split("/");
<i> </i> refDate = new Date(isField.value);
<i> </i> if (splitDate[0] &lt; 1 || splitDate[0] &gt; 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2])))
<i> </i> {
<i> </i> alert('Invalid date');
<i> </i> isField.value = "";
<i> </i> isField.focus();
<i> </i> return false;
<i> </i> }
<i> </i> isField.value = isField.value.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
<i> </i> return refDate;
<i> </i>}

<i> </i>function calc(nForm){

<i> </i> var startDate = validate(nForm['fPay']);
<i> </i> if (startDate)
<i> </i> {
<i> </i> var adj = nP * d;
<i> </i> var dateStr = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+adj);
<i> </i> var slashStr = dateStr.getMonth()+1+"/"+dateStr.getDate()+"/"+dateStr.getFullYear();
<i> </i> nForm['cppFullDate'].value = slashStr.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
<i> </i> }
<i> </i>}
//--&gt;
&lt;/script&gt;

&lt;style type="text/css"&gt;

&lt;!--
fieldset {
width:500px;
padding:10px;
border:3px double #000;
margin:20px auto;
border-color:#0000ff;


}
div {
width:500px;
color:#0000ff;
Float:left;


}
label,input {
display:block;
width:100px;
float:left;
margin:5px 2px;

}

label,text {
display:block;
width: 200px;
float:left;
margin:5px 2px;
color: blue;
}
--&gt;

&lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;
&lt;form name="ded" method="post"&gt;
&lt;fieldset&gt;

&lt;div&gt;
&lt;font face='arial'&gt;&lt;small&gt;This Calculator will determine, based on your income and
pay frequency when you will have reached your maximum Canada Pension and
Employment insurance deductions.&lt;/small&gt;&lt;/font&gt;
&lt;/div&gt;
&lt;hr&gt;

&lt;div&gt;
&lt;label&gt;Gross Pay:&lt;/label&gt;
&lt;input type="text" name="gross"&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;Pays Per Year:&lt;/label&gt;
&lt;SELECT NAME="payF" SIZE=0&gt;
&lt;OPTION VALUE=""&gt;
&lt;OPTION VALUE="52"&gt;52
&lt;option value="26"&gt;26
&lt;option value="24"&gt;24
&lt;option value="12"&gt;12
&lt;/SELECT&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;Date of First Pay:&lt;/label&gt;&lt;/label&gt;
&lt;input type="text" name="fPay"&gt;

&lt;/div&gt;
&lt;hr&gt;
&lt;div&gt;
&lt;label&gt;CPP full deduction/pay:&lt;/label&gt;
&lt;input type="text" name="cppFull" READONLY&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;CPP last deduction amount:&lt;/label&gt;
&lt;input type="text" name="cppLast" READONLY&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;Date last full CPP deduction:&lt;/label&gt;
&lt;input type="text" name="cppFullDate" READONLY&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;Date last CPP deduction:&lt;/label&gt;
&lt;input type="text" name="CPPLasDate" READONLY&gt;
&lt;/div&gt;
&lt;hr&gt;
&lt;div&gt;
&lt;label&gt;EI full deduction/pay:&lt;/label&gt;
&lt;input type="text" name="eiFull" READONLY&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;EI last deduction amount&lt;/label&gt;
&lt;input type="text" name="eiLast" READONLY&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;Date last full EI deduction:&lt;/label&gt;
&lt;input type="text" name="eiFullDate" READONLY&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;label&gt;Date last EI deduction:&lt;/label&gt;
&lt;input type="text" name="eiLastDate" READONLY&gt;
&lt;/div&gt;
&lt;hr&gt;

&lt;DIV&gt;
&lt;TEXTAREA NAME="" ROWS="5" COLS="60"&gt;&lt;/TEXTAREA&gt;
&lt;/DIV&gt;

&lt;div&gt;
&lt;input type="button" value="Calculate" onclick="compute(this.form)"onclick="calc(this.form)"&gt;
&lt;input type="reset" value="Reset" onclick="this.form.gross.focus()"&gt;
&lt;/div&gt;
&lt;/form&gt;


&lt;/body&gt;
&lt;/html&gt;

Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — Looks like you got it separated out by yourself -- at least, this is not the same arrangment you posted earlier. At any rate... I merely reformatted it a bit so that it is easier to tell where functions start and end:
<i>
</i>&lt;script type="text/javascript"&gt;
&lt;!--//
function compute(form){

<i> </i>var p = parseFloat(form.gross.value);
<i> </i>var n = parseInt(form.payF.value);

<i> </i>var pn =(p)/(n);
<i> </i>var pncpp=(p-3500)/(n)// 3500 = basic deduction

<i> </i>var cp = (Math.round((pncpp *0.0495)))// calculated Full CPP Deduction
<i> </i>var ei =(Math.round((pn *0.0195))) // Full EI Deduction

<i> </i>var cppN = (1910.70/(cp)) // calculates number of pays to max CPP
<i> </i>var cppF = (cppN) - Math.floor(cppN);
<i> </i>var eiN = (729.30/(ei)) // calculated number of EI pays to max
<i> </i>var eiF = (eiN)- Math.floor(eiN)
<i> </i>var eiL = Math.round(eiF * ei)
<i> </i>var cppL = Math.round(cppF * ei)

<i> </i>if(isNaN(p)){
<i> </i> alert('Enter Gross Annual Pay');
<i> </i> form.gross.focus();
<i> </i> return;
<i> </i> }

<i> </i>if(isNaN(n)){
<i> </i> form.payF.focus();
<i> </i> return;
<i> </i> }

<i> </i>if((p-3500)*0.0495 &lt; 1910.70) {
<i> </i> alert('Will Not Reach CPP Max of $1910.70');
<i> </i> form.payF.focus();
<i> </i> }

<i> </i>if(p*0.0195 &lt; 729.30) {
<i> </i> alert('Will Not Reach EI Max of $729.30');
<i> </i> form.payF.focus();
<i> </i> return;
<i> </i> }

<i> </i>form.cppFull.value = (cp)
<i> </i>form.eiFull.value = (ei)
<i> </i>form.eiLast.value = (eiL)
<i> </i>form.cppLast.value = (cppL)
}

function validate(isField){

<i> </i>var nP = cppN;
<i> </i>var p = parseFloat(form.gross.value);
<i> </i>var n = parseInt(form.payF.value);

<i> </i>var pn =(p)/(n);
<i> </i>var pncpp=(p-3500)/(n)// 3500 = basic deduction

<i> </i>var cp = (Math.round((pncpp *0.0495)))// calculated Full CPP Deduction

<i> </i>var cppN = (1910.70/(cp)) // calculates number of pays to max CPP

<i> </i>var sel = document.forms[0].payF;
<i> </i>var d, opt = sel.options[sel.selectedIndex].value;
<i> </i>switch (opt) {
<i> </i> case "52": d = 7; break;
<i> </i> case "26": d = 14; break;
<i> </i> case "24": d = 15; break;
<i> </i> case "12": d = 30; break;
<i> </i> default: alert("Check Pay Frequency.");
<i> </i>}

<i> </i>splitDate = isField.value.split("/");
<i> </i>refDate = new Date(isField.value);
<i> </i>if (splitDate[0] &lt; 1 || splitDate[0] &gt; 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2])))
<i> </i> {
<i> </i> alert('Invalid date');
<i> </i> isField.value = "";
<i> </i> isField.focus();
<i> </i> return false;
<i> </i> }
<i> </i>isField.value = isField.value.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
<i> </i>return refDate;
}

function calc(nForm){

<i> </i>var startDate = validate(nForm['fPay']);
<i> </i>if (startDate)
<i> </i> {
<i> </i> var adj = nP * d;
<i> </i> var dateStr = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+adj);
<i> </i> var slashStr = dateStr.getMonth()+1+"/"+dateStr.getDate()+"/"+dateStr.getFullYear();
<i> </i> nForm['cppFullDate'].value = slashStr.replace(/^(d{1}/)/,"0$1").replace(/(d{2}/)(d{1}/)/,"$10$2")
<i> </i> }
}
//--&gt;
&lt;/script&gt;
Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — So, to execute both functions you can do this:

<input type="button" value="Calculate" onclick="compute(this.form); calc(this.form);">
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — And I keep draging this on, I need a book course or something

I copied the update you provided, I tested the it and no value ends up in th text object cppFullDate.

I don't error message nothing
Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — Then the code supplied by the other respondant isn't working. Provide a browserable link to your page and I can debug it.
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — And I keep draging this on, I need a book course or something

I copied the update you provided, I tested the it and no value ends up in th text object cppFullDate.

I don't error message nothing
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — I have not loaded it to my webpage yet.
Copy linkTweet thisAlerts:
@phpnoviceMar 02.2006 — Well, when you do so, then post a link to it.

Cheers.
Copy linkTweet thisAlerts:
@James_GatkaMar 02.2006 — .....
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — below is a link to my web site. I loaded it to my web page and this link is the only way to get to it. Everything works except for populating the date.

There are some feilds which I have not coded yet as their values depends on getting the date calculation to work.

Thank you for your help

[URL=]http://www.tomorrownextweek.com/cpptest.html[/URL]]TestPage[/URL]
Copy linkTweet thisAlerts:
@kprocauthorMar 02.2006 — To test the code I added another button assigning only the the calc function to.

when I click the button it errors out and says form unidentified

any thought
Copy linkTweet thisAlerts:
@phpnoviceMar 03.2006 — I've spent, now, about an hour going over your page. There are numerous errors -- mostly because of having separate functions. Simply, you're going to have to merge all of the code into a single function. The reason for this is partially because there is code in different functions that is trying to reference data that was only created in the other function -- in other words, the data only exists as local variables in the other function(s). So... Merge all the code together into a single function and then start re-arranging the code so that it is logically grouped. Basically, you've got to form a logical plan as to how to approach your data. That is what programming is all about -- being organized.
Copy linkTweet thisAlerts:
@kprocauthorMar 03.2006 — well the good news is I got it working, a special that you to everyone that helped me out. I sure learned a alot.
×

Success!

Help @kproc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...