Ajax form submit problem with refreshing

160 Views Asked by At

I have an ajax form for settings in my site. The user presses an img and then the ajax script calls a php file called set.php. In this file I have a form

<form method="post" action="users/set.php" enctype="multipart/form-data">

If the user updates something it is ok(I have meta to user.php, although the ajax form is reset). However if he presses the button then he is directed to the file users/set.php(something really bad)

I want a suggestion on how to fix this and another one if I can send the queries without refreshing page(no jquery thank you)

Thank you

1

There are 1 best solutions below

3
On BEST ANSWER

You can use JavaScripts preventDefault(), or not have an action at all.