When using input fields its best to wrap them inside a <form> element for semantic markup and so it can be used without the need for javascript

A quick tip a co-worker taught me was to use event.preventDefault() as rather then returnfalse it doesn't allow for the script to continue or reload the page if an error occurs.

In your texter.php file you had isset($POST['msgsubmit']) which wouldn't have worked at all as your AJAX call didn't have any data parameters that contained that key name.

When writing your code its best not to use classes too much as they take longer to find on a page due to them been allowed to appear multiple times. Id's are a more efficient and less time consuming way to write your markup.

thanks, fixed!do u have any idea how to give for js this Message added?

die('success');

just now i have content before the die and now he is saying again Sorry the field is empty!and refreshing chat without page reload after submiting? because when i hit on enter then i can floood many many messages..

[quote="lumix,post:17,topic:83963"]thanks, fixed!do u have any idea how to give for js this Message added?

die('success');

just now i have content before the die and now he is saying again Sorry the field is empty!and refreshing chat without page reload after submiting? because when i hit on enter then i can floood many many messages..[/quote]

The response from chat.php is much more than just "success". This is what the Ajax request is receiving from chat.php