So i've got this simple ajax page: buttons across the top, and a div down below which displays different content depending on what button you press. I want this to be able to interact with a MySQL database i've got so I've got forms and php and whatever but that's not the problem. The problem is that whenever i have a form tag in the code i'm passing to getElementbyID, it doesnt pass anything. I know the code is at least getting to that point in the script, as the alert the line above displays the code i want, but somehow that doesnt get passed to the getElementbyID. Any suggestions?

function makeRequest(url) {

http_request = false;

if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}

if (!http_request) {
alert('Giving up Cannot create an XMLHTTP instance');
return false;
}'GET', url, true);
http_request.onreadystatechange = alertContents;


function alertContents() {

if (http_request.readyState == 4) {
if (http_request.status == 200) {
} else {
alert('There was a problem with the request.');


/*And here's the HTML that should be passing the code*/

<td class="back">
<div class="topbar" width="auto" onclick="makeRequest('edit_act.php')">
<center>Edit Activity</center>

/*and here's the code it should be posting, edit_act.html*/

<form action="add_act.php" method="post"> /*if i delete this form tag, the page displays properly, but then i can't post the info in the form to the database. add_act.php is just a script that posts the info to the database*/
<td><input type="text" name="location" tabindex="1"></td>
<td><input type="text" name="date" tabindex="2"></td>
<td><input type="text" name="duration" tabindex="3"></td>
<td><input type="text" name="description" tabindex="4"></td>
<td><input type="submit" name="submit" value="Add this Activity" tabindex="18" accesskey="enter"></td>
<td><input type="reset" name="reset" value="Start over" accesskey="escape"></td>