kernelgpf
01-22-2009, 07:19 PM
I'm trying to start an Ajax request to return "successfully entered" in the accordingly chosen show URL, but instead, somehow the show ID is showing up instead! I have no idea where this is coming from.
Script: <script type="text/javascript" src="prototype.js"></script>
<script>
function replace(show_id,dog_id) {
new Ajax.Request("ajaxentershow.php",
{
method: 'post',
postBody: 'show_id='+show_id+'&dog_id='+dog_id,
onComplete: showResponse
});
}
function showResponse(req){
$F('foo'+show_id).innerHTML= req.responseText;
}
</script>
<?php
print "<b><a href='#' onClick='replace($row[show_id],$dog_id)'><div id='foo$row[show_id]'>enter this show</div></a></b><br>";
?>
All irrelevant code has been removed so you guys can see where the problem lies. Firebug shows my 'foo' fields are showing up correctly and that the show_id and dog_id are being passed correctly, but I don't think the replace() function I made is being activated because I tried sticking an alert() in there to test it, and it wouldn't show up.
TIA.
-Alyssa
Script: <script type="text/javascript" src="prototype.js"></script>
<script>
function replace(show_id,dog_id) {
new Ajax.Request("ajaxentershow.php",
{
method: 'post',
postBody: 'show_id='+show_id+'&dog_id='+dog_id,
onComplete: showResponse
});
}
function showResponse(req){
$F('foo'+show_id).innerHTML= req.responseText;
}
</script>
<?php
print "<b><a href='#' onClick='replace($row[show_id],$dog_id)'><div id='foo$row[show_id]'>enter this show</div></a></b><br>";
?>
All irrelevant code has been removed so you guys can see where the problem lies. Firebug shows my 'foo' fields are showing up correctly and that the show_id and dog_id are being passed correctly, but I don't think the replace() function I made is being activated because I tried sticking an alert() in there to test it, and it wouldn't show up.
TIA.
-Alyssa