开发者

jQuery animations in forms

let me start with my form:

http://jsfiddle.net/UC开发者_Go百科JpF/

I want to display only one line from the three below selectable options, based on selected stuff. How to do that?

Thanks.


Here's a modified version of your fiddle that should do what you want: http://jsfiddle.net/JZNMy/

The key points are that I reference the row showing the message to the selected option using the value on the option plus '-message' as the id of the message row. Then, I bound to the .change event of the select box, which gets the currently selected value, hides all of the messages, then shows the related one.

EDIT: I updated the fiddle link with one that automatically triggers the change event on the select box to make sure one of the messages is displayed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜