views:

332

answers:

3

I need a simple example of form submission very similar to Twitter. How you type in a comment and click update and without the whole page refreshing, the comment gets added below on top of the rest of the comments. I would prefer something in Jquery as my PHP project is already integrated with it.

+1  A: 

See this pleae.

Sarfraz
But this does'nt tell how I can display the newly message and the old messages on the same page without refreshing.In the sense - do we fetch all the comments again to show on the page after we submit the form via Jquery ? I'm confused
Gublooo
@Gublooo: If you could have shown the code, it would have been much easier. Thanks anyways :)
Sarfraz
A: 

I wrote an example a while ago that more-or-less covers that. Getting data from a form is basic DOM, and you'll want to switch out the GET to POST since you are sending data rather then just requesting it.

David Dorward
Will take a look but its not simple though - I'm very new to programming - thanks for sharing
Gublooo
A: 

I found these links for you:

jQuery plugin: Simplest Twitter-like dynamic character count for textareas and input fields

http://cssglobe.com/post/7161/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas

Or maybe

http://www.ajaxupdates.com/twitter-like-search-with-jquery-and-ajax/

Aim Kai
These links dont explain form submission process of twitter - but thanks for sharing
Gublooo