Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-06-15
2
Medium Priority
?
265 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 1500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

722 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