2
$('#confirm_event').click(function(e){
    var x = $('#function_name').val();
    return confirm('Are you sure you want to submit: ')
})

enter image description here

While this generates the above, I'd like to replace "title bar text" and include var x value in the return confirm message. I tried several ways but returns undefined value or doesn't work at all. How do I customize the dialog box?

Madhawa Ratnayake
  • 189
  • 6
  • 9
  • 25

2 Answers2

3

You cannot change the default dialog's title. Go for any Jquery Ui dialog plugin.

Or some other third party dialog plugins.

Prefer to read :Changing the default title of confirm() in JavaScript?

I prefer to use Jquery Ui dialog :)

Community
  • 1
  • 1
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
1

Well You can not change look of the window's default alert here what you can do.

Use jAlert jQuery Plugin that will let user see custom alert box.

Also Take a Look

Dipesh Parmar
  • 27,090
  • 8
  • 61
  • 90