two way communication between Arduino and a website
hi all,
i have arduino ethernet arduino mega 2560. managed display webpage contain textbox , button. new arduino , html, not sure whether writing code. want use javascript return me textbox's value that being entered , update url arduino can detect.
for example if write value 2 inside text box , click button, in html display current value become 2 next textbox , url become http://192.98.40.2/?2.
i want let arduino know current value 2 well.
here code:
thanks in advance. appreciated!!!
i have arduino ethernet arduino mega 2560. managed display webpage contain textbox , button. new arduino , html, not sure whether writing code. want use javascript return me textbox's value that being entered , update url arduino can detect.
for example if write value 2 inside text box , click button, in html display current value become 2 next textbox , url become http://192.98.40.2/?2.
i want let arduino know current value 2 well.
here code:
code: [select]
client.println("<htmlhead>");
client.println("<body>");
client.println("motor <p>please enter value of motor current value =checkform() ");
client.print("</p>");
client.println("<form method=\"post\" action=\"http://");
client.print(domain);
client.print("m\" onsubmit=\"return checkform()\"><input type=\"text\"id=\"mtr\" /><input type=\"submit\" /></form>");
client.println("<script type=\"text/javascript\"> function checkform() { var mvalue = document.getelementbyid(\"mtr\"); string mv; mv= mvalue.value; return mv;)}</script>");
client.println("</body><html>");thanks in advance. appreciated!!!
quote
i want use javascript return me textbox's value that being entered , update url arduino can detect.
you don't need javascript this. page should contain form submit button. action submit should same original request page. submitted request have ? , other stuff appended, depending on form field names , field contents.
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > two way communication between Arduino and a website
arduino
Comments
Post a Comment