Solved

I need to perform two actions in an onclick submit event can some one help?

Posted on 2006-06-15
2
239 Views
Last Modified: 2006-11-18
I need to perform two actions in an onclick submit event can some one help?  I need to print the page and then redirect to another page. My code is below:


<table width="600" cellpadding=3 cellspacing=1 align=center>
      <tr>
            <td valign="top">
             Brokerage fees, commissions and interest will be deducted from the gain on all cashless exercise.
            </td>
      </tr>
</table><br>


<SCRIPT Language="Javascript">

/*
This script tells the browser to print the page
*/

function printit(){  
      if (window.print) {
               window.print() ;  }
      else {
                var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
            document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
                WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
            }
}
</script>


<table Class=PageNote border=1 cellpadding=3 cellspacing=1  width=600 bgcolor=FAF0C8 bordercolor=FFCC00 align=center>
      <tr>
            <td valign="top">
                        <SCRIPT Language="Javascript">  
                  var NS = (navigator.appName == "Netscape");
                  var VERSION = parseInt(navigator.appVersion);
                  if (VERSION > 3) {
                            document.write('<input type=button value="Print" name="Print" onClick="printit() ">');        }
                  </script>
            </form></td>

      </tr>
</table>      



0
Comment
Question by:Jarvis1
2 Comments
 

Author Comment

by:Jarvis1
ID: 16911748
Anybody out there??? Help????????
0
 
LVL 18

Accepted Solution

by:
Morcalavin earned 500 total points
ID: 16912032
Try this:

function printit(){  
     if (window.print) {
             window.print() ;  }
     else {
              var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
          document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
              WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
          }
window.location.href='http://whereiwanttogo.com/mylocation.html';
}
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Replacing smart quotes from word 7 67
Live mode in DW, need to creae Session 4 79
JSON error 4 54
Classic ASP application Will support SQL 2014 5 76
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now