Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send value to database

Status
Not open for further replies.

onressy

Programmer
Mar 7, 2006
421
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top