I’ve made a simple calendar where you can select year and month through a dropdown list.
<form name=calenderselect method='post' action='calendar.php'>
<select name='month' id='month'>
<option>January</option>
<option>Februari</option>
<option>March</option>
....
</select>
<input type='submit' name='submit' value='Change' />
</form>
I find it abit annoying that you have to press the submit button every time you want to change month. I would like it to change the moment I click the month in the list.
You need a client-side event to achieve this (maybe “onChanged” for the select?)
1.listen for the event: add
onChange="submitForm()to the select tag2.define the
submitForm()javascript function. It will basically be a simple form submit, nothing too longdone!
Look in google: “how to submit form through Javascript”: