Comments (10)
Hey @sourabhtiwari ,
Can you tell me steps to replicate the problem?
Thanks.
from jquery-confirm.
I HAVE A SUBMIT BUTTON ON MY FORM.
AND ON SUBMIT BUTTON CLICK I HAVE CALLED A FUNCTION WHICH EXECUTES Confirm Box
function validate_save() {
$.confirm({
title: 'Confirm!',
content: 'Are You Sure',
confirm: function () {
return true;
},
cancel: function () {
return false;
}
});
}
from jquery-confirm.
Apparently, i can guess, you're doing something like this, where you need to prevent the form's submit action.
$('#yourform').submit(function(e){
e.preventDefault() // Will prevent the page from submit, all you need.
validate_save(); // your function to show the modal.
})
I hope it helps.
from jquery-confirm.
No I want to Submit form but after confirmation.
e.PreventDefault will prevent form submission and than i will be needed to submit data manually by ajax post.
I want to post data directly from form.but after confirmation...
from jquery-confirm.
Alright,
The problem here is, $.alert works asynchronously, so it wont wait until the user does any confirmation.
A right way to do it is,
var shouldPrevent = true;
$('#yourform').submit(function(e){
if(shouldPrevent){
e.preventDefault();
$.confirm({
confirm: function(){
shouldPrevent = false; // if yes, set to false,
$('#yourform').submit(); // and submit the form again.
}
})
}
})
from jquery-confirm.
THANKS A TON @craftpip ...ITS working....
from jquery-confirm.
Have a great day...
do star jquery-confirm & share it.
from jquery-confirm.
Having the same issues, it code above works but I still have to press submit again before it gets submitted :(
from jquery-confirm.
@shamnex , please share your code
from jquery-confirm.
Hi,
please help me! It doesn't work to confirm a submit delete.
When I press "Elimina(delete)", the button close the dialog box but nothing happens.
My code is:
file.php
I have
form id="deletekit"
button id="delete_kitid" type="submit"
file.js
$("#delete_kitid").confirm({
title: "Eliminazione Kit",
content: "Sei sicuro di voler eliminare il kit?",
buttons: {
confirm: {
text: "Elimina",
btnClass: 'btn-danger',
action: function(){
$('#deletekit').submit();
}
},
cancel: {
text: "Annulla",
btnClass: 'btn-default'
}
}
});
Thanks
from jquery-confirm.
Related Issues (20)
- iframe
- How to change the position of a dialog box(Left-top | Right top | Right bottom | Left bottom)
- Scroll Lock (feature or bug)
- Prevent multiple confirm button actions from being triggered
- Goes to link automatically without waiting for the confirmation. HOT 1
- Implement lib into Laravel 10 with Vite.js HOT 2
- Project seems unmaintained HOT 4
- hola como puedo hacer un form para boletin de correo ayudeme
- Countdown timer doesn't work inside jConfirm HOT 1
- Smooth behavior not working anymore
- Close confirm box at the end of the button action
- I like this code HOT 1
- JQuery Confirm Showing Behind Dialog popup
- typescript not available.
- Add iconHtml to customize the icons in confirmation modal
- The `no-scroll` class is not given correctly HOT 1
- animation
- Cannot pass value from form on submission
- Pressing escape when escapeKey is bound to a disabled button closes the dialog HOT 1
- is auto-height a default setting without bootstrap ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-confirm.