Jump to content

Recommended Posts

(split from https://forums.phpfreaks.com/topic/43804-solved-if-confirm-is-no-then-do-nothing/)

But in javascript's confirm box, where do I need to have this <input type="submit" name="submit" value="Cancel order" onclick="return ConfirmCancelOrder();" /> for cancel button?

Edited by requinix
split message
Link to comment
https://forums.phpfreaks.com/topic/317107-if-confirm-is-no-then-do-nothing/
Share on other sites

In the code you provided, it assumes there is a function ConfirmCancelOrder.  As requinix stated, if this is your choice, you only need confirm.  

From a style and usability standpoint, builtin modals like alert and confirm are not used much anymore, because they depend on the browser/os UI kit, and can't be styled to look like the rest of the UI, which looks amateurish.

Most people implement a modal dialog window.  Most css frameworks come with widgets (css + javascript) that are easy to use.  Twitter bootstrap is the grand parent of this idea, and while I don't offer this a recommendation, if you already happen to be using twitter bootstrap, here's a link to documentation for their modal.  Most other css frameworks, or javascript ui frameworks, have similar helpers.  

The general idea is simple and reusable -- your markup will include the div for the modal which starts out hidden, and when needed, you pass some parameters to it for the specific title and message.  

You can usually build your code in a way that makes it easy to include the partial html and javascript you need for any pages that have html forms where you also want confirmation.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.