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

Sachin SinghRank #66 · 26.2K reputationPosted Dec 1, 2020, 5:28 PM EST
Schleid AlexRank #3,087 · 464 reputationPosted Dec 2, 2020, 1:03 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Dec 2, 2020, 1:09 AM EST
Schleid AlexRank #3,087 · 464 reputationPosted Dec 2, 2020, 2:17 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Dec 2, 2020, 2:43 AM EST
Schleid AlexRank #3,087 · 464 reputationPosted Dec 2, 2020, 3:12 AM EST
Schleid AlexRank #3,087 · 464 reputationPosted Dec 2, 2020, 3:49 AM EST