index.asp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebCatPlus DEMO - IO On/Off </title>
<script language="JavaScript" type="text/JavaScript">
<!--
// Read IO state using a special tag
var IO = ^P1.16^;
//-->
</script>
</head>
<body>
<center>
<h1> P1.16 IO port </h1>
<script>
<!--
// Show the current state of IO pin
if(IO == 1){document.write("P1.16 is 1<br><img src='on.gif'>");}
else{document.write("P1.16 is 0<br><img src='off.gif'>");}
//-->
</script>
<!-- Create a special form to change Output //-->
<form method="get" action="index.asp">
<!-- Configure IO as Output //-->
<input name="OUT" type="hidden" value="P1.16">
<!-- Clear the output. We can set the output using "checkbox" //-->
<input name="CLR" type="hidden" value="P1.16">
<script>
<!--
// Create CHECKBOX and show the current state
if(IO == 1)
{
document.write("<input type=\"checkbox\" name=\"SET\" id=\"CLR 2\" value=\"P1.16\" checked>");
}
else
{
document.write("<input type=\"checkbox\" name=\"SET\" id=\"CLR 2\" value=\"P1.16\">");
}
//-->
</script>
<input type="submit" name="" value="Update">
</form>
</center>
</body>
</html>
Screenshot