Gman
unread,Sep 28, 2010, 7:52:30 PM9/28/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Webduino
Hi
I wanted to be able to set variables through a form so I added the
text box function to my library.
You need to add these two functions to the library (WebServer.h) to
use it.
// output HTML for a textbox
void textBox(const char *name, const char *val,
const char *label, bool selected);
void WebServer::textBox(const char *name, const char *val,
const char *label, bool selected)
{
outputCheckboxOrRadio("textbox", name, val, label, selected);
}
Once that is done it is used in much the same way as a radio button or
checkbox
tempstring = 25;
itoa(controlON, tempstring , 10);
server.textBox("TempControlON", tempstring , "On Temp", 0);
This will show a textbox with the value of 25 in it, and a label of On
Temp, the name is TempControlON when returned from a form submit, the
selected variable (value 0) is just there to make for easier
compatibility with the checkbox or radio code. It can be 1 or 0 and is
ignored.