tags:

views:

28

answers:

3

User has html-form, then user fills all field and data transferred to PHP script. How do would data send, but not refresh html page?

A: 

If you don't want the page to be refreshed and submit data, you will have to use the ajax for that, have a look at its tutorial at w3school.com

Sarfraz
thank, I just thought that this problem is solved without AJAXPS thank for link
rebel_UA
@rebel: you are welcome :)
Sarfraz
A: 

Sounds like an AJAX solution. Quick google search

Tommy
A: 

If you want to send the data without refreshing the page, you'll want to do an ajax submit. The easiest way to do this is via the jQuery AJAX Library. A quick example could be:

//example from the jQuery API docs.
$.ajax({
   type: "POST",
   url: "some.php",
   data: $("#form_to_submit").serialize(),
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
 });
Mike Trpcic
thank, but I not fully understood, can You write simple html-form with such use jQuery?
rebel_UA
You would use jQuery to handle the submitting of a form. Just google for "ajax form submit jquery" and you'll find a decent example or two.
Mike Trpcic