Page 1 of 1

Message box YES NO

Posted: Thu Jul 05, 2012 12:02 am
by exoskeleton
masters good day... im using php.. can you help me with message box YES/NO?

i had tride alert ("do you want to delete?");

i know there is something missing to show the buttons YES and NO... can you help me guys ?

tnx in advance..

Re: Message box YES NO

Posted: Thu Jul 05, 2012 6:51 am
by Nullsig
Sadly this is not handled by default in JavaScript. You only have the choice of using the OK Cancel message box for prompts.

There is an option to handle customized buttons using a JQuery library. You could also create an overlay using CSS JavaScript and HTML that will allow you to create fully customizable "Message Boxes".

Re: Message box YES NO

Posted: Thu Jul 05, 2012 9:53 pm
by exoskeleton
i see.. thank you sir Nullsig... how can i put this OK Cancel buttons in jscript? ill take that ... thank you in advance...

Re: Message box YES NO

Posted: Fri Jul 06, 2012 8:28 am
by Nullsig

Code: Select all

<script type="text/javascript">
var r=confirm("Press a button");
if (r==true)
  {
  x="You pressed OK!";
  }
else
  {
  x="You pressed Cancel!";
  } 
</script>