ajax

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
mrreddy
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Dec 24, 2010 11:49 am

ajax

Post by mrreddy » Fri Dec 24, 2010 11:56 am

Error Message: There was a problem while using XMLHTTP:
Not Found

Code:
<html>
<head>
<title>Ajax dropdown code</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}

return xmlhttp;
}

function getDivision(circleId) {

var strURL="findDivision.php?circle="+circleId;
var req = getXMLHTTP();

if (req) {

req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('divisiondiv').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
function getRange(divisionId) {
var strURL="findRange.php?division="+divisionId;
var req = getXMLHTTP();

if (req) {

req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('rangediv').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}

}
//section
function getSection(rangeId) {
var strURL="findSection.php?range="+rangeId;
var req = getXMLHTTP();

if (req) {

req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('sectiondiv').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}

}
</script>
</head>
<body>
<form method="post" action="" name="form1">
<?php
include('external.php');
$query="select * from circle_mst where circle_flag != 'con' order by circle_name";
$result=pg_exec($connection, $query);

?>
<table bgcolor="#999966" align="center" width="400px" border="2" cellspacing="0" cellpadding="0">
<tr>
<td width="150">Circle</td>
<td width="250"><select name="circle" onChange="getDivision(this.value)">
<option value="0">Select Circle</option>
<? while($row = pg_fetch_array($result))
{
echo "<option value=\"$row[0]\">$row[1]</option>";
}
pg_close($connection)
?>
</select></td>
</tr>
<tr style="">
<td width="150">Division</td>
<td ><div id="divisiondiv"><select name="division" >
<option>Select All</option>
</select></div></td>
</tr>

<tr style="">
<td width="150">Range </td>
<td ><div id="rangediv"><select name="range">
<option>Select All</option>
</select></div></td>
</tr>


<tr>
<td width="150">Section </td>
<td ><div id="sectiondiv"><select name="section">
<option>Select All</option>
</select></div></td>
</tr>

<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>

User avatar
219jondn
Joomla! Guru
Joomla! Guru
Posts: 640
Joined: Sat Jun 26, 2010 9:15 pm
Location: Charlotte, NC, USA | Köln, NRW, DE

Re: ajax

Post by 219jondn » Fri Dec 24, 2010 11:33 pm

aaand ... what are we looking at here? Whats the problem? What are you looking to do?
Would help if we knew what was happening here :)
Respectfully,
Jon Neubauer
Tweet at me @219jondn


Locked

Return to “General Questions/New to Joomla! 1.5”