Javascript post

ok, how to clear input field value after submitting form?

if (data === 'success') {
refresh('mon','chatinc');
$('input[type="text"]', this).val('');

last line doesnt clear…

That the moment of the ajax response, the this keyword is going to be the ajax object, not the form as you seem to expect.

This will work:

$(‘input[type=“text”]’, ‘#myForm’).val(‘’);

This will work:


$('input[type="text"]', '#myForm').val('');

sweet…
big thanks for your patience, javascript guru!! :slight_smile: