Answer the question
In order to leave comments, you need to log in
Ajax: autocomplete fields?
Let's say this is the situation. There is an ajax application in which the login form looks something like this :
<form><br>
<input type="text" name="ajax-username" /><br>
<input type="password" name="ajax-password" /><br>
<input type="submit" /><br>
</form><br>
var form = document.querySelector( 'form' );<br>
<br>
form.addEventListener( 'submit', function (e) {<br>
ajaxLogin(function () {<br>
form.innerHTML += '<br /> success';<br>
});<br>
e.preventDefault();<br>
}, false);<br>
e.preventDefault()
the , then the page will reload after submitting the form. Answer the question
In order to leave comments, you need to log in
1. Make yourself a fake address that does nothing and returns a 200 response
2. Specify this fake address in the form and _target = "iframe_name" (of course there should be a frame)
2. Before Ajax sending data to the correct address, do a real submit of the form.
3. Log in with Ajax, see how the browser asks if you remember your login/password
4.!!!
5. PROFIT!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question