Solved

Run 2 <A Href> commands from one button click (how to)

Posted on 2008-10-21
2
884 Views
Last Modified: 2012-05-05
I have the following 2 pieces of code :

<a href="scriptcode1:Browser(&quot;Browser&quot;,&quot;<SrcDir>\folder1\page1.htm&quot;)"><img id="Button1" class="inputImage" src="../button22-up.jpg" onmouseover="doRollOver(this);" onmouseout="doRollOut(this);" onmouseup="doClick(this);" onmousedown="doClick(this, true);" ondragstart="return false" onselectstart="return false">
</a>

and

<a href="scriptcode1:RunScript(&quot;s1&quot;)">

I need to run both at the same time so i need to fit the above (runscript) code into the one at the top (which works )
0
Comment
Question by:nathan1038
2 Comments
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 500 total points
ID: 22772717
The way to open TWO LINKS AT ONCE (which is what I presume you are asking) is to follow this --

<a href="link1.htm" target="_blank" onclick="window.open(this.href,'one','');window.open('link2.html','two','');return false;">open 2 links</A>

You will have to adapt that to your needs, but the logic is simple --

The first is a link which when clicked opens a page in a new window.  The onClick() handler opens the second link in the original window, and by returning false, does not stop the main link opening.

Adapt that, and you are rolling.
0
 
LVL 6

Expert Comment

by:ysfx
ID: 22778207
You could include the second script in the first script... like the following:

<a href="scriptcode1:Browser(&quot;Browser&quot;,&quot;<SrcDir>\folder1\page1.htm&quot;);scriptcode1:RunScript(&quot;s1&quot;)"><img id="Button1" class="inputImage" src="../button22-up.jpg" onmouseover="doRollOver(this);" onmouseout="doRollOut(this);" onmouseup="doClick(this);" onmousedown="doClick(this, true);" ondragstart="return false" onselectstart="return false">
</a>

Hope that works
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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

867 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

23 Experts available now in Live!

Get 1:1 Help Now