Re: HTML form input to a string
Posted: Sun Aug 07, 2016 7:34 pm
MANY thanks MartinAyotte!!! This is EXACTLY what I was looking for!!
Regds
Paul
Regds
Paul
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
martinayotte wrote:For submitting the form values, you need a separate URL for the POST (adjust your form action as followed) :Code: Select all<form action='http://192.168.4.1/submit' method='POST'>
And add a new handler for it :Code: Select allserver.on("/submit", handleSubmit);
Then, in your handlerSubmit, you will get values by parsing arguments :Code: Select allif (server.args() > 0 ) {
for ( uint8_t i = 0; i < server.args(); i++ ) {
if (server.argName(i) == "fname") {
// do something here with value from server.arg(i);
}
}
}