我在rails中有一个text_field_tag,我已经将它的id指定给了jquery-ui-datepicker。一切都很好。但是,即使在页面刷新之后,文本字段中的值仍然存在。对此有什么解决方案吗?
<%= text_field_tag("meeting_filter_from") %>
Jquery代码:
jQuery('#meeting_filter_from').datepicker({dateFormat: 'MM dd, yy', showOn: 'both', buttonImage: '/images/calendar.gif', buttonImageOnly: true});
发布于 2011-08-21 02:32:57
在ready上,让jquery清除该字段:
jQuery(function(){
jQuery('#meeting_filter_from').val("");
jQuery('#meeting_filter_from').datepicker({dateFormat: 'MM dd, yy', showOn: 'both', buttonImage: '/images/calendar.gif', buttonImageOnly: true});
});
https://stackoverflow.com/questions/7132179
复制相似问题