问题描述:

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?

网友答案:

You can bind it this way using JQuery:

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

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

网友答案:

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

网友答案:

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
相关阅读:
Top