...

View Full Version : Text replacement with URL help?



kernelgpf
01-22-2009, 08: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

kernelgpf
01-23-2009, 05:43 PM
I simply changed the function name because I wondered if maybe it was a built in function, and now it says my function isn't defined, though it clearly is.

Help?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum