Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

ReferenceError: document is not defined....help

$
0
0

I'm trying to add 1 year to the date placed in one text box and have the results appear in another text box. example put date 04/25/2015 in "tx4" (text box name) and I want date 04/25/2016 to appear in tx15 (text box name)


Now I've formatted the text boxes to "date" mm/dd/yyy


When should I "trigger" this script to occur?


I think the below script will work but not sure...am I explaining it right?

 

var curr_date = new Date(document.getElementById('tx4').value);      sets the variable "curr_date" to the whats in text box "tx4" right?

 

var review_date = new Date(curr_date.setMonth(curr_date.getMonth() + 12));      sets the variable "review_date" to the date in "tx4" plus 12 months (or 1 year) right?

 

document.getElementById('tx15').value = review_date.format("MM/dd/yyyy");       places the variable "review_date" into the text box "tx15" right?


for something that should be sooo simple....geez...


Viewing all articles
Browse latest Browse all 12130

Trending Articles