<form action='http://...... (solved)

#include <ESP8266WiFi.h>;
#include <DNSServer.h>
#include <EEPROM.h>  
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

int valeur;
const byte DNS_PORT = 53;
String Argument_Name ;                          // contient les nom des arguments
IPAddress apIP(192, 168, 1, 1);                 // Ip choisie pour le serveur AP
DNSServer dnsServer;
ESP8266WebServer webserver(80);
//MDNSResponder mdns;
WiFiServer server(80);


void handleRoot()
{    String IPaddress=apIP.toString();
     String webpage = "<html><head><meta name='viewport' content='width=device-width, initial-scale=1' /></head><body>";
     Serial.println(" au départ valeur vaut : ");
     Serial.println(valeur);             
     webpage += "<form action='http://" + IPaddress + "/' method='POST'>Valeur : <input type='number' name='valeur' min='12' max='254' value= ";
     webpage +=  String(valeur) + "><input type='submit' value='Valider'></form>";
     webpage += "<form action='http://" + IPaddress + "/'><input type='submit' value='Mise &agrave; jour affichage' /></form>";
     webpage += "</body></html>";
     webserver.send(200, "text/html", webpage); 
     if (webserver.args() > 0 )                                      
         {    for ( uint8_t i = 0; i < webserver.args(); i++ )
                   {   Argument_Name = webserver.argName(i);              
                       if (webserver.argName(i) == "valeur") 
                         {  Serial.println(" au milieu valeur vaut : ");
                            Serial.println(valeur);   
                            valeur = webserver.arg(i).toInt();
                            Serial.println("enfin valeur vaut : ");
                            Serial.println(valeur);  }
                           }     }     }

void setup() 
 {  ESP.eraseConfig();                              
    Serial.begin(115200);
    delay(500);
    Serial.println("\n=====================\n");                               
    WiFi.softAPdisconnect();
    WiFi.mode(WIFI_AP_STA);                 
    WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); 
    WiFi.softAP("ESP8266");
    dnsServer.start(DNS_PORT, "*", apIP);   
    IPAddress apip = WiFi.softAPIP();
    Serial.print("Se connecter à \n");  Serial.println(apip);   
    dnsServer.start(DNS_PORT, "*", apIP);
    webserver.begin(); 
    webserver.onNotFound([]() { handleRoot(); });
    webserver.on("/", handleRoot);
    delay(50); 
    Serial.println("Serveur HTTP démarré");        }

void loop()
{    dnsServer.processNextRequest();              
     webserver.handleClient();            }

We have a form that asks for a value …
We enter it and we validate …

And : no change in the display
and you must click on update display for the field to update.

In detail … How does a form work?

I dry … How to avoid the second form and the validation of the first suffice?

The value is updated in memory but after refreshing the “value” area

End the year on a failure …: - (((

the FORM action can be a relative url. it doesn't need to contain protocol host and port. but you need a name for the action and an 'on()' handler for it. so action='/form1Arcion' and server.on("form1Action", handleForm1Action). in handleFormArction you can use server.arg("valuer") to get the value

Thanks My english and my html code practice are poor. A little piece of code would be my preference

fr: Thanks My english and my html code practice are poor. A little piece of code would be my preference

example SimpleAuthentification

Basically you have the handleRoot() function in the wrong order

void handleRoot() {
  if (webserver.args() > 0 )  { 
    for ( uint8_t i = 0; i < webserver.args(); i++ ) { 
      Argument_Name = webserver.argName(i);
      if (webserver.argName(i) == "valeur") { 
        Serial.println(" au milieu valeur vaut : ");
        Serial.println(valeur);
        valeur = webserver.arg(i).toInt();
        Serial.println("enfin valeur vaut : ");
        Serial.println(valeur);
      }
    }
  }
  
  String IPaddress = apIP.toString();
  String webpage = "<html><head><meta name='viewport' content='width=device-width, initial-scale=1' /></head><body>";
  Serial.println(" au départ valeur vaut : ");
  Serial.println(valeur);
  webpage += "<form action='http://" + IPaddress + "/' method='POST'>Valeur : <input type='number' name='valeur' min='12' max='254' value= ";
  webpage +=  String(valeur) + "><input type='submit' value='Valider'></form>";
  webpage += "<form action='http://" + IPaddress + "/'><input type='submit' value='Mise &agrave; jour affichage' /></form>";
  webpage += "</body></html>";
  webserver.send(200, "text/html", webpage);
}

Should help, i am not sure about taking the compare to argName(i) but you said it updates the value in memory so it does work.
you go to the page, and the page gets send back to your browser, then you put a value and press ‘valider’ which submits the form (causing a new call to handleRoot(), then you should extract the data, and you can also see the new data in your page (as you make it part of your new form) and then the new page gets send to you. and within loop() server.handleClient() awaits your action. No need for drama !

also shouldn't all these '

='number'

be \"

=\"number\"

also you can try changing also the method from post to get, so you will see what is actually send to your browser.

A big thank-you

I should have deduced from my serial output
the following code fully meets my expectations

#include <ESP8266WiFi.h>;
#include <DNSServer.h>
#include <EEPROM.h>  
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

int valeur;
const byte DNS_PORT = 53;
String Argument_Name ;                          // contient les nom des arguments
IPAddress apIP(192, 168, 1, 1);                 // Ip choisie pour le serveur AP
DNSServer dnsServer;
ESP8266WebServer webserver(80);
WiFiServer server(80);


void handleRoot() {
  if (webserver.args() > 0 )  { 
    for ( uint8_t i = 0; i < webserver.args(); i++ ) { 
      Argument_Name = webserver.argName(i);
      if (webserver.argName(i) == "valeur")
         {  valeur = webserver.arg(i).toInt();   }      }       }
  String IPaddress = apIP.toString();
  String webpage = "<html><head><meta name='viewport' content='width=device-width, initial-scale=1' /></head><body>";
  webpage += "<form action='http://" + IPaddress + "/' method='POST'>Valeur : <input type='number' name='valeur' min='12' max='254' value= ";
  webpage +=  String(valeur) + "><input type='submit' value='Valider'></form>";
  webpage += "</body></html>";
  webserver.send(200, "text/html", webpage);
}

void setup() 
 {  ESP.eraseConfig();                              
    Serial.begin(115200);
    delay(500);
    Serial.println("\n=====================\n");                               
    WiFi.softAPdisconnect();
    WiFi.mode(WIFI_AP_STA);                 
    WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); 
    WiFi.softAP("ESP8266");
    dnsServer.start(DNS_PORT, "*", apIP);   
    IPAddress apip = WiFi.softAPIP();
    Serial.print("Se connecter à \n");  Serial.println(apip);   
    dnsServer.start(DNS_PORT, "*", apIP);
    webserver.onNotFound([]() { handleRoot(); });
    webserver.on("/", handleRoot);
    webserver.begin(); 
    delay(50); 
    Serial.println("Serveur HTTP démarré");        }

void loop()
{    dnsServer.processNextRequest();              
     webserver.handleClient();            }