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
Schleid Alex
NA
361
48.2k
Jquery to load page automatically
Dec 1 2020 5:58 PM
Hi there,
I have a view with an input field and a button when the button is clicked it triggers a jquery function to check where the value in the field is null or not if null I show a jquery alert saying the value cannot be nul
here is the script
$(document).ready(function(){
$('#btnAdd).on('click', function(){
if($('#Quantity).val()>0)
{
....
}
else
{
alert('Quantity cannot be null')
}
})
my problem is after the alert is displayed it goes straight to the index page instead of staying on the create one. I dunno why, could someone help me out please
Regard
Schleid
Reply
Answers (
7
)
Routing pages to allow any controller except home
Asp.Net Core Razor display an error message from if...else