Solved

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

Posted on 2006-06-15
2
238 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

11 Experts available now in Live!

Get 1:1 Help Now