I would like to create a form in html/css/jquery whereby when a correct password (password is there for gimmicky reasons - not security) is entered, the submit button to a mailchimp form is activated - without clicking a button.
-
you could try making an ajax request with just the username/password but dont know why you want that and make an icon when success returnedJoy Biswas– Joy Biswas2015-08-18 19:05:57 +00:00Commented Aug 18, 2015 at 19:05
-
There's no username. It's an access code - and as it's not important that its secure - I wanted to avoid learning ajax (started coding a few months ago)Nicholas– Nicholas2015-08-18 19:07:24 +00:00Commented Aug 18, 2015 at 19:07
Add a comment
|
1 Answer
Without posting anything you have tried, I would suggest you try using jquery keyup to check if the input password is correct. If so, run your bit of code. Else, you can give them an error message.
https://jsfiddle.net/cshanno/tdzL7y2k/
HTML
<input id='password' type='text' /> <span id='validPassword'></span>
JQUERY
$('#password').keyup(function(){
if($(this).val() === "password") {
$('#validPassword').text('Correct'); // do action here
} else {
$('#validPassword').text('Incorrect');
}
});