i need a help with java scriptamortization table using java script
Page 1 of 1
13 Replies - 1758 Views - Last Post: 02 July 2007 - 12:34 AM
#1
i need a help with java script
Posted 06 June 2007 - 05:46 AM
thank you
Replies To: i need a help with java script
#2
Re: i need a help with java script
Posted 06 June 2007 - 05:51 AM
Could you show us your Javascript so we can help?
Also, please specify what error(s) are you encountering, and what is the expected result.
#3
Re: i need a help with java script
Posted 07 June 2007 - 03:56 AM
1lacca, on 6 Jun, 2007 - 05:51 AM, said:
Could you show us your Javascript so we can help?
Also, please specify what error(s) are you encountering, and what is the expected result.
First what i am trying to do is a date series based on a certain date, like those used in the amortization table, actually its an amortization table, but my problem is the generation of dates some how i did this script but the result was when i reach Dec (12) the next date generated is the month 13 it does not go for the next month wihch should be jan. (1) next year, i am using adobe designer to desinge a form.
this is the script:
var d = new Date(TextField1.formattedValue);
var mmonth = d.getMonth() + 1 ;
mmonth++;
TextField2.formattedValue = mmonth;
var mday = d.getDate();
var myear = d.getFullYear()
TextField2.formattedValue = mday + "/" + mmonth + "/" + myear ; //(curr_date + "-" + curr_month + "-" + curr_year);
Attached File(s)
-
Untitled1.pdf (63.44K)
Number of downloads: 84
#4
Re: i need a help with java script
Posted 08 June 2007 - 05:11 PM
2¢
#5
Re: i need a help with java script
Posted 08 June 2007 - 11:37 PM
DilutedImage, on 8 Jun, 2007 - 05:11 PM, said:
2¢
Thank you very much for your replu, unfortunitly it did not wotk, when i remove "mmonth++", the value i got id the same i entered.
#6
Re: i need a help with java script
Posted 09 June 2007 - 02:13 PM
if(mmonth >= 13) { mmonth = 1 };
#7
Re: i need a help with java script
Posted 10 June 2007 - 11:52 PM
DilutedImage, on 9 Jun, 2007 - 02:13 PM, said:
if(mmonth >= 13) { mmonth = 1 };
Thanks alot, but it did not work too, this is what i did
----- form1.#subform[0].DateTimeField2::calculate - (Javascript, client) ---------------------------
var d = new Date(DateTimeField1.formattedValue);
var mmonth = d.getMonth() + 1 ;
mmonth++;
if(mmonth >= 13) { mmonth = 1 } {myear + 1};
DateTimeField2.formattedValue = mmonth;
var mday = d.getDate();
var myear = d.getFullYear()
DateTimeField2.formattedValue = mday + "/" + mmonth + "/" + myear ; //(curr_date + "-" + curr_month + "-" + curr_year);
#8
Re: i need a help with java script
Posted 11 June 2007 - 05:05 AM
if(mmonth >= 13) { mmonth = 1; myear + 1};
The curly braces enclose the code that is to be executed if the IF condition is met, and the semicolons separate each line of code.
#9
Re: i need a help with java script
Posted 13 June 2007 - 07:42 AM
DilutedImage, on 11 Jun, 2007 - 05:05 AM, said:
if(mmonth >= 13) { mmonth = 1; myear + 1};
The curly braces enclose the code that is to be executed if the IF condition is met, and the semicolons separate each line of code.
thank you very much for the clarification, i will try it and let you know
#10
Re: i need a help with java script
Posted 26 June 2007 - 03:58 AM
hammoudeh, on 13 Jun, 2007 - 07:42 AM, said:
DilutedImage, on 11 Jun, 2007 - 05:05 AM, said:
if(mmonth >= 13) { mmonth = 1; myear + 1};
The curly braces enclose the code that is to be executed if the IF condition is met, and the semicolons separate each line of code.
thank you very much for the clarification, i will try it and let you know
the main problem with me now is the date format, how can i do the format day,month,year, what happend with me that : i do input a date in a cell which the script will read from, the script read the format as month, day , year and produce it in the next cell day, month, year.
#11
Re: i need a help with java script
Posted 26 June 2007 - 05:53 PM
#12
Re: i need a help with java script
Posted 27 June 2007 - 05:23 AM
DilutedImage, on 26 Jun, 2007 - 05:53 PM, said:
I am sorry for not being clear,
if the input is "6/27/2007 " the result is "27/7/2007", what i am asking for is how to do the script to read it as "27/6/2007" to produce "27/7/2007"
this is the script one more time...
var d = new Date(TextField1.formattedValue);
var mmonth = d.getMonth() + 1;
var mday = d.getDate();
var myear = d.getFullYear()
mmonth++;
if(mmonth >= 13)
{
myear++;
mmonth = 1;
};
TextField2.formattedValue = mmonth;
TextField2.formattedValue = mday + "/" + mmonth + "/" + myear; //(curr_date + "-" + curr_month + "-" + curr_year);
[mod edit] And here am I again adding code tags for you. The code tags are there for a reason, use them.
This post has been edited by hotsnoj: 27 June 2007 - 07:17 AM
#13
Re: i need a help with java script
Posted 27 June 2007 - 12:14 PM
#14
Re: i need a help with java script
Posted 02 July 2007 - 12:34 AM
|
|

New Topic/Question
Reply



MultiQuote




|