Monday, September 22, 2008

Java script Confirm with Yes No buttons

You can write javascript with diffrent button options like YesNo, YesNoCancel etc.
You can change the code 4132 and see the O/P.
To Complete this task, just write following java script in your code,
< script language=javascript >

function window.confirm(str)
{
  execScript('n = msgbox("'+str+'","4132","Title")', "vbscript");
  return(n == 6);
}

</script>

In this script, the line will execute vbScript's Message box withYesNo Option.
execScript('n = MsgBox("Yes Or No?",vbYesNo,"Title")', "vbscript");

No comments: