JavaScript : 1 Form 2 Target

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
        <script type="text/javascript">
         <!--
         function submitView()
         {
           myform = document.form1;
           myform.target="_blank";
           myform.action="view.php";
           myform.submit();
           return false;
         }
         
        function submitEdit()
         {
           myform = document.form1;
           myform.target="_blank";
           myform.action="edit.php";
           myform.submit();
           return false;
         }
 
         //-->
         </script>
1
2
3
4
<form name="form1" method="post">
<input type="submit" name="SubmitV" value="- View -" onclick="submitView();">
<input type="submit" name="SubmitE" value="- Edit -" onclick="submitEdit();">
</form>


Written by Komkid on January 27th, 2010 with no comments.
Read more articles on JavaScript and Programming.

Related articles

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:

You have to be identified to write a comment.