This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JavaScript confirm with Yes/No

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a confirm box in javascript with yes/no options. is it possible without using VB script?
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

This post has been moved to a more appropriate forum.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create a div that looks like a prompt box and display it on top, other than that there is no way to do it. I think in this day in age peopla are using to the buttons of confirm and cancel.

Eric
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How about this?

var flag=confirm("Are you sure you would like to delete this record?","Yes","No");

regards
sudha
 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by sudha swami:
var flag=confirm("Are you sure you would like to delete this record?","Yes","No");


What exactly is that supposed to do?
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
It will come up with the message "Are you sure you want to delete ..." with OK and Cancel button. If the user clicks OK then it will be interpreted as true otherwise false. If true, the form can be submitted so that the record can be deleted on the server side. If false, it will be remain in the same screen.
regards
sudha
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by sudha swami:
Hi,
It will come up with the message "Are you sure you want to delete ..." with OK and Cancel button. If the user clicks OK then it will be interpreted as true otherwise false. If true, the form can be submitted so that the record can be deleted on the server side. If false, it will be remain in the same screen.
regards
sudha



He knows how the confirm works....
If you read the post he wants a confirm with yes an no buttons.
Your previous post with the "Yes","No" does nothing to help since the confirm accepts one argument.

Eric
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic