All pastes #345564 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-02-08 16:58 UTC
rendered paste body
    if (document.all)
      http = new ActiveXObject('MSXML2.XMLHTTP');
    else
      http = new XMLHttpRequest();


					var newTR = document.createElement("TR");
					var newTD = document.createElement("TD");
					var newForm = document.createElement("FORM");
					newForm.id = "theForm";
					
					
					newForm.appendChild(newParentTable);
					newTD.appendChild(newForm);
					newTR.appendChild(newTD);
					
					document.getElementById("placeholder").appendChild(newTR);
					
					document.getElementById("theForm").setAttribute("onSubmit", "return sendData();");





		function sendData() {
			var myurl = "http://www.host.name/script.php";

			if (document.getElementById("myIn").checked == true) {
				var status = "in";
			}
			else if (document.getElementById("myOut").checked == true) {
				var status = "out";
			}

			var doc = null;
			
			alert("Saved!");
			http.open("GET", myurl + "?updatedata=1&contactID=7&status=" + status + "&comments=" + escape(document.getElementById("myComments").value), false);
			http.send(null);
			doc = http.responseXML;
			
			return false;
		}