This is a migrated thread and some comments may be shown as answers.
HTMLAttributes & AutoComplete
2 Answers 47 Views
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 21 Oct 2015, 03:52 PM

It seems that the default behavior of the control is to set autocomplete="off" which is fine except Chrome does not like to adhere to this standard.

 Developers should be allowed to override the this default behavior if need be to set the autocomplete type of the textbox, however, setting this via the htmlattributes does not do anything.

 

Example using the MVC Wrappers:

html.Kendo().MaskedTextBoxFor(e).Mask(mask).HtmlAttributes(new { @class = "form-control", autocomplete = "tel-national" })

 

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 23 Oct 2015, 09:51 AM
Hello Nick,

Indeed, the widget will set the autocomplete="off" attribute explicitly. In order to accomplish your goal, you will need to set the autocomplete attribute after widget initialization:
@* MVC wrapper is defined here *@
 
<script>
  $(function() {
      var id = "@Html.IdFor(your model)";
      $("#" + id").attr("autocomplete", "tel-national");
  });
</script>

I would suggest you share your request in our Feedback for further consideration.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Nick
Top achievements
Rank 1
answered on 23 Oct 2015, 12:51 PM
Thanks Georgi - this is the work around that I came up with as well and am using.  I'll share this request via feedback as it feels like it is bug.  Thanks again!
Asked by
Nick
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Nick
Top achievements
Rank 1
Share this question
or