php - Windows alert javascript with redirect function -
this script
<script> function myalert() { alert("you have changed username, logged out in order changes applied"); } </script>
and button
<input type="submit" value="save" name="btnpass" class="button" onclick="myalert()";/>
i wanted know if there's way how add redirect script when "okay" button @ alert click. how can add on script? how can add on script? thanks!
use confirm
instead of alert
the window.confirm() method displays modal dialog optional message , 2 buttons, ok , cancel.
function myalert() { var confirmed = confirm("you have changed username, logged out in order changes applied"); // if ok button clicked if (confirmed) { window.location.href = 'google.com'; } return false; // stop form submitting }
Comments
Post a Comment