1

In another question on this site, someone recommended creating a bookmark with the following javascript in the URL box to automatically fill in your user name and password on a website in Chrome:

javascript:function%20enterLogin(){username="your_username";password="your_password";document.getElementById('user_name').value=username;y=document.getElementById('password').value=password;}enterLogin();

My question is whether there is any way to alter this code so that it sends an "enter" key press to the browser after it enters your user name and password (to eliminate one more step).

Jeff
  • 13
  • 3

2 Answers2

3

I don't think this is possible, but you can submit the form using JavaScript:

document.forms["myform"].submit();

You just need the id of the form you want to submit in JavaScript — if there's no ID, you can use the index of the form (a number greater than or equal to 0). Since this is site specific, just test a bit to see what works.

Daniel Beck
  • 111,893
1

You could modify the code to look like this:

javascript:function%20enterLogin(){username="your_username";password="your_password";document.getElementById('user_name').value=username;y=document.getElementById('password').value=password;document.forms["your_form"].submit();}enterLogin();

Just replace your_form with the name of your form.

JW8
  • 1,202
  • 3
  • 13
  • 26