How to show popupalert using javascript in my jsp page? -
i have used confirm("")
popup alert function of javascript
in jsp
page , shows 'ok'
, 'cancel'
button want 'yes' , 'no'
instead.
please tell me there way or there alternative it.
if using confirm statement in javascript cant change it. have create custom confirmation box using java script or jquery. here optional method without using jquery or javascript
<style type="text/css"> div#popup { position:absolute; display:none; top:200px; left:50%; width:500px; margin-left:-250px; border:1px solid blue; padding:20px; background-color:white; } </style> <a href="http://example.com/" onclick="document.getelementbyid('popup').style.display = 'block'; return false;" >go example.com</a> <div id="popup"> <p>are sure want go example.com?</p> <p> <a onclick="document.location='http://example.com/'; return false;"> yes </a> <a onclick="document.getelementbyid('popup').style.display = 'none'; return false;"> no </a> </p> </div>
also can use jquery
function askuseryesorno() { var mydialog = $('<div class="mydialog"><p>yes or no?</p><input type="button" id="yes" value="yes"/><input type="button" id="no" value="no"/></div>'); $("#yes").click(handleyes); $("#no").click(handleno); mydialog.modal(); //this have replaced whatever syntax modal framework uses } function handleyes() { //handle yes... } function handleno() { //handle no... }
Comments
Post a Comment