hi i'm trying to send a radio button selection to access db. Since the ASP page uses a simple insert call, i think the issues is in the formulating of the AJAX script. In the html i have two radio buttons like so:
<form name="f1">
<input type='radio' value='1' name='Contrib' onChange='javascript:a1(this.value)'>Yes
<input type='radio' value='0' name='Contrib' onChange='javascript:a1(this.value)'>No
</form>
JS:
var xmlHttp
function a1(str)
{
if (str.length==0)
{
document.getElementById("txtHint").value=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="11.asp"
url=url+"?q="+a1
xmlHttp.open("POST",url,true)
xmlHttp.send()
}
function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
11.asp:
request.queryString("q")
and insert into table, close connection, etc...
///////////////////////
Any thoughts as to why:
xmlHttp.open("POST",url,true)
xmlHttp.send()
is not working? Thanks
<form name="f1">
<input type='radio' value='1' name='Contrib' onChange='javascript:a1(this.value)'>Yes
<input type='radio' value='0' name='Contrib' onChange='javascript:a1(this.value)'>No
</form>
JS:
var xmlHttp
function a1(str)
{
if (str.length==0)
{
document.getElementById("txtHint").value=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="11.asp"
url=url+"?q="+a1
xmlHttp.open("POST",url,true)
xmlHttp.send()
}
function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
11.asp:
request.queryString("q")
and insert into table, close connection, etc...
///////////////////////
Any thoughts as to why:
xmlHttp.open("POST",url,true)
xmlHttp.send()
is not working? Thanks