fabien-d / alertify.js

JavaScript Alert/Notification System
http://fabien-d.github.com/alertify.js/
4.26k stars 726 forks source link

not working with firefox #268

Closed TeeeeJay closed 7 years ago

TeeeeJay commented 7 years ago

Hello Fabien,

i am sorry to bother you with this problem of mine after closing the maintenance of alertify, but the thing is its the best among all others and i need to implement it on my online website, and i dont know front end that much and i am responsible of all the project, i put alertify and it worked on chrome as intended, but on firefox it didnt work i will show u the code i asked online millions of times they said u need to pass the event its not define but i dont know how to do that please help me i will show below my code

`` and html is below

<form action='Allocated.php' method='post' name='disc'> <input type='submit' name='disc' value='Discontinue Asset' formnovalidate='formnovalidate' id='conf1' onclick='return xFunction();' />

please help me how to do that in order to make it work on firefox and sorry for bothering you.

fabien-d commented 7 years ago

This is not an alertify.js issue. This is a form handling/submission issue. Without changing your code, the following would work.

Pass the event object from the markup:

- onclick='return xFunction();'
+ onclick='return xFunction(event);'

Add the event object as a parameter:

- xFunction = function() {
+ xFunction = function(event) {

Now the preventDefault() will stop the form from submitting so you'll have to submit it programmatically when the dialog is confirmed.

- $('#conf1').click();
+ $('form').submit();

you can look at a quick "working" example on CodePen: https://codepen.io/fabien-d/pen/c2874e38af19af131d088afc75bdf2d2

TeeeeJay commented 7 years ago

Thank you so much for your reply yes its working i guess, but i have something wrong in my php as when i submit the form i cant get the POST to query the DB, maybe i will just use the browser alert with return true and return false better for my time. Thank you so much again.

TeeeeJay commented 7 years ago

Fabien it worked Perfectlyyy Thank you so muchhh it was my mistake first the things you corrected for me then in submitting the forms, i had so many forms on a single page it was a mess Thank you so much again you are the best