I'm using this form I found :
<FORM METHOD="POST" ENCTYPE="x-www-form-urlencoded">
<input type="text" id="Password"/>
<input type="button" id="Access" onclick="document.location=Password.value" VALUE="Accès"/>
</FORM>
It works fine for what I want to do, but I would like to allow the command to be triggered by pressing enter too. I have read a solution using the submit
type instead and also a solution adding
onkeydown="if (event.keyCode == 13) document.getElementById('Access').click()"
in the text input.
Neither works so I don't know if I'm misusing them or if my document.location=Password.value
cannot be used this way. If so, could you indicate me the simplest solution to replace it without using php or js file because I don't really understand that. This website will not be public so I don't really care about security or if it's not the right way to do.
EDIT : Considering the answer you gave me are not fully working (jlbruno's one does not work neither on enter or on click, riad's one only works on click), here is the full code of my page with riad's solution, please tell me if something could interfere
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>JVPW Cloud - Le Nuage de la JVPW !</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="Design" href="design.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<p><center><img src="logo.png" width="1000" height="400" /></center></p>
<p><span style="font-family:Verdana"><b>Tout l'univers de la JVPW pour seulement 9.99 $</b></span></p>
<h1>Bienvenue</h1>
<p>Si vous disposez d'un early access gratuit, entrez le code ci-dessous et appuyez sur Accès (pas Entrée !)</p>
<FORM METHOD="POST" ENCTYPE="x-www-form-urlencoded">
<input type="text" id="Password" onkeydown="if (event.keyCode == 13) document.getElementById('Access').click()" />
<input type="button" id="Access" onclick="window.location=document.getElementById('Password').value ;" VALUE="Accès"/>
</FORM>
</body>
</html>