Jump to content

help with span and ajax!


countdrac

Recommended Posts

im having trouble with this ajax! when the javascript function gets called it does what it is supposed but it just puts it in the wrong place -

not in the span as its meant to and what is meant to be changed in the span just stays there....

 

function getSearch()
{
alert(document.getElementById('searchDiv').value);          // this just says 'undefined'	
document.getElementById('searchDiv').innerHTML = "WHAT???";   //this never appears anywhere
... all othe ajax stuff
...
}

function StateChangedSearch() 
{ 
if (xmlHttp.readyState==4)
{ 
	document.getElementById('searchDiv').innerHTML = xmlHttp.responseText; // this does not insert into 'searchDiv' - it inserts it above where its meant to be
}
}

 

and then the form and the page....

 

<form class="uploadForm" name="goNext" onsubmit="return formValidatorUpload()" method="post" >
<span id="theForm">
<table>				
   <?php
..............
        ............
        ..........

<span id='searchDiv'>
<tr><td colspan=1><u>Recently Added Shiurim</u></td></tr>";
$query = "SELECT * FROM shiurim, speakers, category
ORDER BY shiur_upload_date DESC LIMIT 5";
$result = mysql_query($query) or die(mysql_error());	
while ($row = mysql_fetch_array($result)) 
	{
	        echo "<tr><td>";
		echo "Speaker: ".$row['speaker_name'] ."<br />";
		echo "Title: ".$row['title'] ."<br />";
		echo "Year: ".$row['shiur_year'] ."<br />";
		echo "Category: ".$row['category_name'] ."<br />";
		echo "Description: ".$row['description'] ."<br />";
		echo "Date: ".$row['shiur_date'] ."<br />";
		echo "<a href='./audioEditShiur.php?shiur_id=".$row['shiur_id']."'>Edit Shiur</a>";
		echo "</tr></td>";
	}
         echo "</span>";
        ....
?>
          </table>
</span>
</form>												

 

thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.