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

Running a Date Script, checking to see if the Field is empty

$
0
0

I have a Date Script

     var f = this.getField("WeekEndDate");

     var d = new Date(f.value);

     d.setDate(d.getDate()-6);

     event.value = util.printd("mm/dd/yyyy", d);

 

This works fine, but when the Filed Name "WeekEndDate" is blank you get error messages. I was hoping to adjust the script so that if WeekendDate.length == 0 if would blank out the filed were the script is located and if WeekendDate.length > 0 it would run the above script but I do not know how. Can someone help me please


Viewing all articles
Browse latest Browse all 12130

Trending Articles