Comments (5)
It's not much use outside the form, no?
from disableautofill.js.
How so? If you specify the form
attribute, you can still submit the form as you would normally do.
from disableautofill.js.
Oh nevermind I see. I missed that part.
It should be fairly straightforward to select all the inputs with that form attribute
from disableautofill.js.
The caveat is, that you would need to do a full DOM scan for any elements that were directed to that form. When applying it to the form, you are looking at all the children, while if you take into consideration the elements occurring outside the form... Well, you would basically need to do this:
jQuery(document.body).on('click', 'input[type="submit"]', function(e) {
// first check to see if the click input has a form attribute
var formId = jQuery(this).attr('form');
if (formId.length) {
e.preventDefault(); // prevent form from submitting prior to performing operations
// then you will want to grab that attribute, and target the form in question:
jQuery('#' + formId).disableAutoFill() // or whatever. You may even need a custom function inside the library itself to forcibly perform the replacements against the form instead of listening for a click.
this.submit(); // submit form once all processes are complete? maybe as a callback even to the `disableAutoFill()`
}
});
Something like that may be the best bet.
TL;DR - you will basically need to listen on all nodes that have the form="whatever"
attribute in order to intercept appropriately. There are messy ways and messier ways to do this, and some not-so-messy.
from disableautofill.js.
Can we apply this on particular text filed not for all the password fill. I dont have form tag but want to apply this on password fill.
Please suggest on this.
from disableautofill.js.
Related Issues (20)
- publish on NPM HOT 1
- I'm getting "Error: type property can't be changed" HOT 1
- Fields are not randomized back after attempt to submit when html5FormValidate is true HOT 1
- asterisk in password HOT 1
- event is not defined
- Small feature
- Cannot read property 'join' of undefined
- disableAutoFill does not seem to support the formaction attribute
- Multiple forms not working HOT 1
- Empty password and confirm password error- Uncaught TypeError: Cannot read property 'join'
- Submitted password value "●●●●●●●●●", not the actual password HOT 13
- Crashing..... as The required anti-forgery form field No Present.
- How to serialize form after randomizing fields
- reinitialize
- Refactor Array.prototype.insert function
- not working when label tag is before input in Chrome - solution offered
- pressing enter to submit doesn't use form's action url
- Safari autofill still running - am I doing something wrong? HOT 1
- Can you release a chrome extension as well to disable the chrome auto fill pop ups ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disableautofill.js.