Login and Password Box with JavaScript
 08 September 2017
 Rodrigo Costa Corrêa

If you need that the user type some information before proceed to an url, you can use javaScript of a very simple way.

In the example below, when the user clicks in a link, the JavaScript will request the login and the password to proceed. These values will be passed as parameters in the url. If the user don't type the login or the password, the user will not be redirected to the configured url.

JavaScript code:
function passwordBox() {
			var login = prompt("Please type your login:","");
			var pass = prompt("Please type your password:","");
			if (pass != null && pass != "" && login != null && login != ""){
				window.open("http://YOUR_URL/?l="+login+"&p="+pass);
			}
		}
Html code to call the function:
<a onClick="passwordBox()" href="#" >LINK</a>