[pmwiki-users] How to get the value of a text field form before posting ?

Patrice PELLE patrice-pelle at bbox.fr
Wed Jul 27 07:52:34 CDT 2016


Hello,

I am a true beginner in PHP and HTML. I am trying to make a form that I hope will someday end up in a cookbook.

In the following test form, I would like to get the value of the input text before posting :

<!DOCTYPE html>
<html lang=fr>

<head>
<title>Test</title>
<meta charset = "UTF-8">

</head>


<body>
	<form action = "<?php echo $_SERVER["PHP_SELF"];?>" method = post >

		Admin Password : <input type="password" name = "AdminMdP" style="width: 20em;" required  >

		How to get here the value of AdminMdP to make some PHP treatment (suffiscient length, special characters,…), any time the value is changed ?

		<input type="submit"  name ="OkButton" value = "Enter">
	</form>
</body>

<?php

if (isset($_POST['OkButton'])) 
{
    $AdminMdP = $_POST["AdminMdP"];
    echo $AdminMdP;
}
?>

I  looked for some answers in the internet, but examples in jQuery, AJAX, JavaScript are useless for me. They suppose you know what it means, which is quite not my case. I told you, I’m a true beginner :)


Thanks for your help


Patrice
patrice-pelle at bbox.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20160727/1d354416/attachment.html>


More information about the pmwiki-users mailing list