Posted on 2005-04-21
Can someone help me by writing a function that I can call using the onclick property of my submit button that will do the following:
If checkindate and checkoutdate are both null then ALLOW the form to post.
If checkindate is not null and checkoutdate is null then DO NOT ALLOW the form to post and errormessage alert should be "Checkout date must be filled in"
If checkoudate is not null and checkindate is null then DO NOT ALLOW the form to post and errormessage alert should be "Checkin date must be filled in"
If checkoutdate <= checkindate then DO NOT ALLOW the form to post and errormessage should be "Checkout date must be later than checkin date"
This question is worth 500 points not because of the difficulty since it seems pretty straightforward (although I am clueless in JS) but because of the urgency.