• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5589
  • 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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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