• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5591
  • Last Modified:

Dialog box for Yes/No

any idea how to write a yes/no box in java scripts
function Edit_onclick()
{
                            dialogbox with yes /no
                            if(yes)
             window.location.href = "http://xyz.com/xyz/ custSaveframe.asp"
                           else
                            do nothing

}
0
ajaypappan
Asked:
ajaypappan
  • 2
  • 2
2 Solutions
 
Michel PlungjanIT ExpertCommented:
Simplest is OK/Cancel:

function Edit_onclick() {
  if (confirm('Are you sure???')) window.location.href = "http://xyz.com/xyz/ custSaveframe.asp"
}
0
 
RoonaanCommented:
You can have a dialogbox with ok/cancel using:

ok = confirm('You are about to delete some file. Are you sure?');

if(ok) {
  //do something
} else {
  //do something else
}

-r-
0
 
Michel PlungjanIT ExpertCommented:
Excuse me?
0
 
RoonaanCommented:
ajaypappan, mplugjan was earlier with the same answer. Please ask community support to reassign points.

-r-
0
 
ajaypappanAuthor Commented:
iam sorry both guys are right..I dnt know how to ask for community support, but if u can split up the points it wil be fine for me
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now