If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

Post a form with AJAX

Hi!
I'm trying to do a chatboard. I had one that worked really fine, but I've migrated to wordpress and had to include it in a template to make it work, and since I was changing it a bit, I wanted to have AJAX error messages that would stay on the page and would not require going to the php file page.
Anyway, here's the script. It's very simple for the moment, I plan on checking for spam word, checking the IP against a IP list I have of known spammers, but for now, I just wanted to know if it worked, and... it doesn't.
If I refresh the page, the new entries show alright. But the script is supposed to make the newest entry appear beneath the form, as well as an error message in case something went wrong. I have neither.
I've spent hours on this ajax thing already and I could gladly use some help...

I tried to alert(data) to see what came through and got nothing, so the problem must be getting the data back from the post2.php file... I now they go through from the form to the post2.php file since they are written into the database.
I could definitely use some help, here Thanks!

Sorry, forget it, it does work. I've had problems with my internet connection lately and I guess I messed up with one upload. I also changed the path to post2.php to a relative one instead of an absolute one, and I think that's what got things running.

However, I still do have a question: is there a way to return the time and date ? Like I was using to show the result: