Moderators - please delete this as it is in the wrong forum.
I would reference this: http://www.w3schools.com/js/js_obj_date.asp:
var myDate=new Date();
myDate.setFullYear(2010,0,14); //January 14, 2010
var today = new Date(); //today
alert("Today is before 14th January 2010");
alert("Today is after 14th January 2010");
Thanks for the reply. I've asked the forum moderators to delete the thread as I foolishly put this message in the wrong place. I'm reposting it in the Designer forum.
BTW, I get an error when I try to post the value to the field. "syntax error near token minWage":
this = minWage;
this.rawValue = this.rawValue; // a bit redundant really, so you could exclude it completely.
or if minWage is a variable within scope of the script, then:
this.rawValue = minWage;
If you give me the whole section, or upload your form to Acrobat.com I can help you out further.
The moderators will probably just move the thread, so filling out this one is still fine.
// workDate will be set to another field (datetime format) that the user
// can modifiy and the whole form updated with new values at that time
var workDate = new Date();
var prior10Date = new Date(2010,07,01);
var prior09Date = new Date(2009,07,01);
var minWage = 8.25;
if (workDate < prior10Date) then
minWage = 8.00; // last year amount
if (workDate < prior09Date) then
minWage = 7.75; // prior year amount
this = minWage;
The error in the last line is:
Error: syntax error near token "minWage" on line 13, column 14
I've posted the reply in the Designer forum...