<script type="text/javascript">
var xmlhttp
function loadXMLDoc(url)
{
// code for Mozilla, etc.
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest()
xmlhttp.open("POST",url,true)
xmlhttp.setRequestHeader("Content-Type","text/plain")
xmlhttp.onreadystatechange=state_Change
xmlhttp.send(null)
}
// code for IE
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp)
{
xmlhttp.open("POST",url,true)
xmlhttp.setRequestHeader("Content-Type","text/plain")
xmlhttp.onreadystatechange=state_Change
xmlhttp.send(null)
}
}
}
function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
{
// if "OK"
if (xmlhttp.status==200)
{
alert("XML data OK")
document.getElementById('A1').innerHTML=xmlhttp.status
document.getElementById('A2').innerHTML=xmlhttp.statusText
document.getElementById('A3').innerHTML=xmlhttp.responseText
}
else
{
alert("Problem retrieving XML data:" + xmlhttp.statusText)
}
}
}
function noSubmit(){
return false;
}
</script>
</head>
<body>
<h2>Form</h2>
<form method=post onsubmit="return noSubmit()">
Enter the csr: <textarea name="csr" cols="10" rows="6"></textarea>
<input type="submit" name="Submit" value="Submit" onClick="loadXMLDoc('[URL unfurl="true"]http://secure.comodo.net/products/!DecodeCSR')">[/URL]
<p><b>response:</b>
<br><span id="A1"></span><span id="A2"></span><span id="A3"></span>
</p>
</form>