tags:

views:

136

answers:

3

On this page: http://www.blackdownluxurylettings.co.uk/place_booking/2010-3-18,2

I am using an onchange event on the "number of days" select box to update the "departure date" field.

But currently nothing is happening.

Any ideas?

A: 

If I recall correctly, the regular Javascript onChange event only fires once the select box loses focus AND it's contents have been changed. I don't know how jQuery achieves it, but their change method will fire whenever the contents are updated.

Also, I get the following error in my Javascript console when loading your page:

[cycle] terminating; zero elements found by selector
Topher Fangio
+1  A: 

Just looking at it quickly: wouldn't you want the ONCHANGE event attached to the SELECT tag rather than the individual options?

Todd
Well noted, thanks guys
Andy
A: 

You can bind it this way using JQuery:

$("#ddlNumberOfDays").bind('change', mainPharmacy_Change)

Maybe for javascript, you should just try 'change'.

Colour Blend
As @Todd: pointed out, it should be bound to the SELECT tag instead. Don't forget to return false.
Colour Blend