Text Box sended with Arduino as a server with HTML

Hello! I’m writing code to program a sketch that allows arduino to turn on/off a LED through a web page sended with Arduino code in HTML. And I want to put a textbox that says the status of the LED

        if (petition.indexOf("LED=0") > 0 ) {
          client.println("<id="form1" name="form1" method="post" action="">");
          client.println("<label for="statusLED"></label>");
          client.println("<input name="statusLED" type="text" id="statusLED" value="LEDOFF" readonly="readonly" />");*/

and in the error console appears:

sketch_sep01a.ino:61:37: error: expected ‘)’ before ‘form1’
sketch_sep01a.ino:62:44: error: expected ‘)’ before ‘satusLED’
sketch_sep01a.ino:63:45: error: expected ‘)’ before ‘sratusLED’
sketch_sep01a.ino:63:129: error: expected primary-expression before ‘/’ token

Thanks, sorry 4 my english.

    client.println("<id="form1" name="form1" method="post" action="">");

You need to escape all the " that you want println() to actually send:

    client.println("<id=\"form1\" name=\"form1\" method=\"post\" action=\"\">");

form1 is a lousy name for a text box.

client.println("<id=“form1” name=“form1” method=“post” action="">");

The problem is more your knowledge of C/C++ than your knowledge of English.

When sending double quotes within a C-string that is delimited by double quotes, you can either escape the double quotes within the string:

client.println("<id=\"form1\" name=\"form1\" method=\"post\" action=\"\">");

Or you can use single quotes in HTML instead:

client.println("<id='form1' name='form1' method='post' action=''>");

Thanks! Well it's my first sketch, little by little.. ::slight_smile: