Monday, April 29, 2013

Popup window in javascript

Add those lines between head tag.


<script type="text/javascript">
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','height=350,width=800,left=10,top=10,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
</script>

Create a form inside body tag.


<?php
print "<form action=\"JavaScript:newPopup('comment.php');\" method=\"POST\">";
print "<input type=\"hidden\" name=\"rnum\" value=\" $ac_no\">";
print "<td><input type=\"image\" id=\"enter\" name=\"submit\" src=\"images/comment.gif\">";
print "</td>";
print "</form>";
?>

Create a simple html or php page which you want to be popped out.

Enjoy your pop out window having all editable properties[height=350,width=800,left=10,top=10,resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no].

No comments:

Post a Comment