TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sachin Singh
7
55.8k
82.8k
Html 5 required validation with ajax without refreshing the page.
Jul 31 2020 1:39 AM
I know to use Html 5 validation with ajax we generally use submit event handler and not button with preventDefault click like below
<form method=
"post"
id=
"subsForm"
>
<div
class
=
"input-group"
>
<input type=
"email"
required>
<input type=
"submit"
>
</div>
</form>"
$(
'form'
).submit(
function
(event){
event.preventDefault();
$.ajax(){
// submit data to controller
}
});
Ok , thats a good solution to force Html 5 validation to work without submitting the form but it violates the definition of Ajax and causes to refresh the page when page is submitted with satisfied validations.
Is there any solution till date to use html 5 validations without page refresh.
Reply
Answers (
6
)
in sweetalert how to change background color in button
How to overwrite file in database with ajax