Solved

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

Posted on 2008-10-21
2
876 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

708 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

15 Experts available now in Live!

Get 1:1 Help Now