Hi
I have a form with a date field which defaults to today's date, called date1. I also have checkbox, cb1, which I want to have the effect that if it is checked it copies the value of date1 into a second date field date2. The complications are that if the user has overwritten the default value of date1, the checkbox must copy the overwritten value not the default, and if the user checks the checkbox and subsequently changes date1, it is automatically changed in date2. If a user checks the box and later unchecks it, the unchecking must delete the value previously written to date2. Ultimately, date2 will be a hidden field.
i.e. if cb1 is checked, date1 = date2, whatever the order the user has done things. If cb1 is unchecked then date2 is empty.
I'm afraid this is beyond my rudimentary javascript skills. Can anybody assist please?
Thanks in advance for any pointers.
Tim
I have a form with a date field which defaults to today's date, called date1. I also have checkbox, cb1, which I want to have the effect that if it is checked it copies the value of date1 into a second date field date2. The complications are that if the user has overwritten the default value of date1, the checkbox must copy the overwritten value not the default, and if the user checks the checkbox and subsequently changes date1, it is automatically changed in date2. If a user checks the box and later unchecks it, the unchecking must delete the value previously written to date2. Ultimately, date2 will be a hidden field.
i.e. if cb1 is checked, date1 = date2, whatever the order the user has done things. If cb1 is unchecked then date2 is empty.
I'm afraid this is beyond my rudimentary javascript skills. Can anybody assist please?
Thanks in advance for any pointers.
Tim