I have a list of dates for events that customers can book via a form. At the moment, I have some cumbersome onclick script attached to <a> tags:
<h4>New York</h4>
<a onclick="$('#buy-form').animatescroll({scrollSpeed:700,easing:'easeInOutSine'}); document.getElementById('date').value='20-24 January'; document.getElementById('venue').value='New York'; $('#resicheck').attr('disabled', true);">20-24 January</a>
This scrolls the page using the animatescroll jquery plugin, sets the date input on the form, sets the venue input on the form, and disables a checkbox. There are multiple dates for each venue so it adds a lot of code and is generally nasty.
I'd lack to package all this into a neat function, but how can I get the relevant venue and date text to use, bearing in mind the dates vary and there are multiple venues?