-->
Page 1 of 1

Range Slider control without Submit button

PostPosted: Thu Mar 23, 2017 1:35 am
by Pindi King
Hi,

Need help to modify this code to remove Submit button and receive the slider update. What should be the change in if(request.indexof("submit') = !1) statement ????

Code: Select all
  if(request.indexOf("submit") != -1)   //this is used to ignore "favicon.ico" and other requests
 
// Return the response
  client.println("<!DOCTYPE HTML>");
 
  client.println("<html>");
  client.println("<head>");
  client.println("<title> Level Setting </title>");

  client.println("<form method=get><br>Level:  <input type='range' min='1' max='100' name=levelVal value='levelTemp' oninput='showValue(this.value)'>");
  client.println("<span id='range'>50</span>");
 
  client.println("<script type='text/javascript'>");
  client.println("function showValue(newValue)");
  client.println("{");
  client.println("document.getElementById('range').innerHTML=newValue;");
  client.println("}");
  client.println("</script>");
 
  client.println("&nbsp;<br><br><input name=H type=submit value=submit><br><br>"); 
 
  client.println("</head>");
  client.println("</html>");

  delay(1);
  Serial.println("Client disonnected");
  Serial.println("");