Here's a link to a screenshot of my console. When I click the form this displays for a moment before the page reloads and the console is refreshed. To view this I have to hit the stop bottom before it reloads the page. It reloads because there isn't a value in the action attribute of the form. http://picasaweb.google.com/lh/photo/soYaBaQlN-u-kyhLpQHToA?feat=directlink
As you can see from the console, there isn't a response from the page I'm trying to send the POST. I have verified the path and i know it's correct. Clicking on the response tab shows a button labeled 'Load Response'. When clicked nothing happens. How do I interpret this. Here is the java script and below the form. $(document).ready(function() { $('#193').live('submit',function(){ var formData = $(this).serialize(); console.log(formData); $.post('setTechGoal.php', formData, function(data){ console.log (data)}); }); }); <form id="193" accept-charset="utf-8"> <input type="hidden" name="tech" value="193"> <input type="hidden" name="location" value="Redding"> <input type="hidden" name="week" value="48"> <input type="submit" value="Set Goal →"> $<input type="text" name="techGoal" value="" size="10"> </form> On Nov 25, 2:36 pm, Peter Edwards <p...@bjorsq.net> wrote: > Hey, > > don't use document.write() or alert() to debug - either use > console.log() or have a div in the document which can display debugging > information and append any data to it. > > $('#testform').live('submit',function(){ > var formData = $(this).serialize(); > console.log(formData); > $.post('ajax/setvalue.php', formData, function(data){ console.log(data) > }); > > }); > > Firebug should log the POST as well as any response from it as well. > > HTH > > on 25/11/2009 21:10 Rockinelle said:: > > > > > Any new eyes out there? Not sure why this got changed to accessibility > > discussion. > > > On Nov 24, 4:46 pm, Rockinelle <ericbles...@gmail.com> wrote: > > >> Hey everyone, > > >> I've been trying to make a .post work for me and I'm using firebug to > >> attempt to debug my problems. I am trying to use ajax to process a > >> form and from what I can tell in Firebug, I am not getting a response. > >> Now I have removed the action in the form itself so it's just reloads > >> the page after the .post fails. > > >> $('#testform').live('submit',function(){ > >> var formData = $(this).serialize(); > >> alert(formData); //to verify the data is formatted properly and it > >> is. > >> $.post('ajax/setvalue.php', formData, function(data) > >> { document.write(data) }); > > >> }); > > >> The path to the remote script is correct. formData is formatted > >> properly. The php doc only echo the string 'pass' to let me know it > >> got the request. I'm using .live rather than .submit because the form > >> is loaded via an ajax call so it waits for the form to load before it > >> binds this ajax request to the form. > > >> So if you have some tips on my code great, but I'd really like a good > >> tool to debug this myself. Maybe there is something in firebug I'm > >> missing.