2

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!

jeffery_the_wind
  • 17,048
  • 34
  • 98
  • 160

1 Answers1

2

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');
}
DisplayName
  • 3,093
  • 5
  • 35
  • 42
  • Yes thank you this is the first thing I tried too after I posted. It is successfully setting the autocomplete attribute = "on". Unfortunately autocomplete is still not working on the form. – jeffery_the_wind Sep 13 '12 at 18:00
  • Maybe try setting it on the form itself too $('#FrmGrid_yourgridid').attr('autocomplete', 'on'); – DisplayName Sep 13 '12 at 18:18
  • yeah that didn't change anything. I think that it has something to do with the way the form is submitted. These edit forms are submitted via ajax, and I think the browser is not prompted to save the autocomplete history unless the forms are submitted in the traditional manner... It is just funny because the autocomplete worked for a long time with our jqGrid forms by default, and suddenly about a month ago they stopped working. – jeffery_the_wind Sep 13 '12 at 19:05
  • @jeffery_the_wind - Regarding that "about a month ago they stopped working" - Did you just recently upgrade jqGrid? What versions? – Justin Ethier Sep 20 '12 at 14:13