I tried stop form refreshing the page but it refreshes page every time i submit the form.
This is a common problem, and is easily solved.
Just get rid of the tags and instead use:
Then create a submit()
method in Javascript that performs the desired operations.
This stops the form from posting back to the page.
If you need to POST the data somewhere, use JQuery's .post()
method in the submit()
method:
http://api.jquery.com/jQuery.post/