This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Mach V3: Autocomplete off
Started 12 years ago by chinuba | 3 posts |
-
Hi
I have my cool forms and I use them in a secure environment.
However, I want to automatically disable browser autocomplete in the form.I have the JS for this:
<script type="text/javascript">window.onload = function() {
for(var i = 0, l = document.getElementsByTagName('input').length; i < l; i++) {
if(document.getElementsByTagName('input').item(i).type == 'text') {
document.getElementsByTagName('input').item(i).setAttribute('autocomplete', 'off');
};
};
};<script>
Question:
Where do I apply this script so that auto complete is disabled once the form is loaded? Does Machform V3 have this feature automatically?Posted 12 years ago # -
There is an easier way to do this. You can edit the view.js file which is located under your machform folder.
Search around line 3 for this code:var field_highlight_color = $("form.appnitro").data('highlightcolor');
right below that code, add this line:
$("form.appnitro :input").attr("autocomplete","off");
that should set the autocomplete attribute to off
MachForm Founder
Posted 12 years ago # -
Thank.. really helpful
Posted 11 years ago #
Reply
You must log in to post.