开发者

onchange event from select box to update field

开发者 https://www.devze.com 2022-12-23 18:05 出处:网络
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\" f

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?


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


You can bind it this way using JQuery:

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

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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号