Go Premium for a chance to win a PS4. Enter to Win

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
?
266 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 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

885 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