javascript: set hidden field if date after Jan 15
问题 I have a quick one that I'm struggling with after a long day! I have a form with a hidden field with the name of 'grant_cycle'. If the form is submitted after January 15, it should be give the value of 'Spring, [year]', or after July 15 should be 'Fall, [year]'. Could you kind people send me in the right direction, please? :-) Thanks! EDIT: Added year bits. 回答1: One option would be: retrieve the year of submission first create the date of January 15th in that year create the date of July 15th