cj333
cj333

Reputation: 2609

How to empty the search box after submit in ajax jquery submit without page refresh?

I need a ajax submission system without page refresh, I found one from the submit-a-form-without-page-refresh-using-jquery script site

After remove jquery-ajax\images\form_bg.png, How to empty the search box after submit the data? Can anyone add a small code for me? Thanks.

Upvotes: 0

Views: 330

Answers (2)

Nono
Nono

Reputation: 7302

    Try this:



          $.ajax({
               type: "POST",
               url: "your-php-file.php",
               success: function(get_ajax_return_value){
                 $('#yoursearchbox_id').val('');
               }
             });

Upvotes: 1

dlock
dlock

Reputation: 9577

Try this:

$('#searchbox_id').val('');

Upvotes: 1

Related Questions