Set PINK default value within a user web page
I created a web page which uses an xmlHttpRequest allowing you set a Default value in the PINK module.
It posts to the built-in DEFAULTSET.HTM to effect the change.
NOTE: You will have to enter the name and password just like when you use the VV_show.htm page to update variables.
You enter the variable name or number (e.g. ET, 00-19 ...) and the new default value and click the button to set the default.
Post Edited (ronczap) : 9/21/2009 8:13:20 PM GMT
It posts to the built-in DEFAULTSET.HTM to effect the change.
NOTE: You will have to enter the name and password just like when you use the VV_show.htm page to update variables.
You enter the variable name or number (e.g. ET, 00-19 ...) and the new default value and click the button to set the default.
<html>
<head>
<title></title>
<script language="javascript">
var xmlRequest; function SetDefault() {
var varname = document.getElementById("variable_name").value;
var newval = document.getElementById("NewVal").value;
var msg = 'variable_name=' + varname + '&NewVal=' + newval;
HttpReqPost(msg);
}
function HttpReqPost(sendtext) {
var URL;
URL = "DEFAULTSET.HTM ";
xmlRequest = getXMLHttpRequest();
xmlRequest.open("post", URL);
//xmlRequest.setRequestHeader("variable", "");
xmlRequest.setRequestHeader("Content-Type", "text/xml");
//xmlRequest.setRequestHeader("Connection", "close");
xmlRequest.onreadystatechange = processReqChange;
xmlRequest.send(sendtext);
}
function getXMLHttpRequest() {
if (window.XMLHttpRequest) {
return new window.XMLHttpRequest;
}else{
try {
return new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
catch(ex) {
alert("No http request capability");
return null;
}
}
}
function processReqChange() {
if (xmlRequest.readyState == 4) {
if (xmlRequest.status == 200) {
// alert(xmlRequest.responseText); // ...processing statements go here...
// respval.innerText = xmlRequest.responseText;
}else{
alert("There was a problem sending the XML data:\n" +
xmlRequest.status + " " + xmlRequest.statusText);
}
}
}
</script>
</head>
<IMG src="images\parallax-web-server.jpg" width="519" height="73">
<br>
Enter variable name/num (ET, ES..., 00 - 19) <input id=variable_name name=variable_name value="" sise=2>
<br>
Enter new value <INPUT id="NewVal" NAME="NewVal" TYPE="text" SIZE="64" VALUE="">
<br>
<INPUT type="button" value="Set Default" id=button1 name=button1 onclick="return SetDefault()">
</BODY>
</HTML>
Post Edited (ronczap) : 9/21/2009 8:13:20 PM GMT

Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
50 72 6F 6A 65 63 74 20 53 69 74 65
·