Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text replacement with URL help?

    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:
    Code:
    <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

  • #2
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •