jqgrid edit form autocomplete=“off” by default, how to change to autocomplete=“on”

陌路散爱 提交于 2019-12-11 01:15:01

问题


Recently my edit forms for jqgrid have not been having the nice autofill functionality that is common to Google Chrome and Firefox. I found that the jqGrid edit forms are being rendered with each <input> having this property:

autocomplete="off"

In JqGrid what do I have to do in my grid definition to remove this property or set it to autocomplete="on"?

I do not see anything about it in the ColModel definition or the edit form options. Any help here would be really great!

Thanks!


回答1:


I do not believe that there is anything in the edit API to enable autofill on a field in the edit form. Though you could do it using jQuery in the event afterShowForm and set the autocomplete property on any of the fields that you wish. The ID's of each field is the same as the name in your column model.

afterShowForm : function (formid) {
    $('#name').attr('autocomplete', 'on');
}


来源:https://stackoverflow.com/questions/12411836/jqgrid-edit-form-autocomplete-off-by-default-how-to-change-to-autocomplete-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!