Hello,
Date field 1 is user entered.
Date field 2 I want to be user entered, UNLESS the first date field is entered. If the first date is entered as 10/2/2012, then I'd want date 2 to have the default 10/2/2012. If possible, I'd like to let the user override.
I've been playing around but I'm not sure which javascript function to use. I'm really familiar with rawvalue but not for whatever the value would be in a date field. Any suggestions?
Thanks so much!
Solved! Go to Solution.
Views
Replies
Total Likes
You could do something like:
//on exit event of first date field
if (DateTimeField2.isNull) {
DateTimeField2.rawValue = this.rawValue;
}
Depends on how you want to treat the second date field. In the sample above I've specified to only set the value of the second date field if it's empty. That way if someone has set the second date field and goes back and changes the first date field nothing will happen.
Views
Replies
Total Likes
You could do something like:
//on exit event of first date field
if (DateTimeField2.isNull) {
DateTimeField2.rawValue = this.rawValue;
}
Depends on how you want to treat the second date field. In the sample above I've specified to only set the value of the second date field if it's empty. That way if someone has set the second date field and goes back and changes the first date field nothing will happen.
Views
Replies
Total Likes
Thanks for the idea. Can I make DateTimeField2 calculated only when DateTimeField1 has been entered? Otherwise, I'd like the users to be able to choose their own DateTimeField2 value.
Views
Replies
Total Likes
That's what that script does essentially...when the person exits the first date field the second date field is set to the same value unless the second date field already has a value. The filler can still set the value of the second date field.
If you are not worried about overwriting a value in the second date field you can remove the if statement and just use DateTimeField2.rawValue = this.rawValue;
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies