How do I copy input from one textbox to another via checkbox using jQuery?

Posted by Jesse on Stack Overflow See other posts from Stack Overflow or by Jesse
Published on 2009-04-01T16:40:58Z Indexed on 2010/06/10 4:12 UTC
Read the original article Hit count: 295

Filed under:
|
|

I'm cleaning up a simple form that has a Start Date textbox and an End Date textbox. I want to add a checkbox in between these fields that the user can check if the End Date is the same as the Start Date, so when they check it, the Start Date input value (e.g., 04/01/09) will automagically appear in the End Date textbox, so they don't have to type in the same date twice. Does that make sense?

BTW, I'm using the sexy jquery datepicker UI, and it's sweet, but I just can't figure out the above problem.

I know there's a simple solution (event handler?) but I'm stumped.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery