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

Patrice PELLE patrice-pelle at bbox.fr
Wed Jul 27 11:46:41 CDT 2016


to answer your question, I can’t assess my knowledge. To put it with my words and my understanding :
i would like to display a form to be filled , I think client side
I would like to make a first processing of some data, at the input time. The purpose of this treatment is, for example, 
to give specific information depending on the input, to help the person filling the form to understand what he is doing. A very basic example : display either « Mr» or "Mrs «  depending on the check of a radio button,
to check some input property to be sure that the input is valid. A basic example would be to check the length of a password. In my opinion, it’s no need to send improper data to the server. 
I think this should still be client side.

When the form is filled, the user click the submit button, and the valid data are processed on the server (for example storage in some file server side). Globally, this last part seems to work. I get some difficulties due to typing error, « (,{«  mismatch, « ; » forgotten or extra. Just being patient 

Does it answer your baseline question ?



> Le 27 juil. 2016 à 18:27, Peter Kay <pkay42 at gmail.com> a écrit :
> Let me ask you baseline question:  how well do you understand the
> client/server nature of webpages?
> Which relates directly to the question: what exactly do you want each
> one of them to be doing with the form?
> --Peter
> On Wed, Jul 27, 2016 at 8:52 AM, Patrice PELLE <patrice-pelle at bbox.fr> wrote:
>> 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
>> _______________________________________________
>> pmwiki-users mailing list
>> pmwiki-users at pmichaud.com
>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20160727/3a2ea347/attachment.html>

More information about the pmwiki-users mailing list