Solved

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

Posted on 2006-06-15
2
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

615 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