PDA

View Full Version : launchinIE in select dropdown


eyna
12-16-2010, 08:05 AM
Hi

How to add the launchinIE in select dropdown menu?
it does work in simple html link, the file is stored in a network drive.

i.e.
<a href="javascript:launchApp('L:\\filename.exe')">Meeting Room Booking - Mapletree</a>

but I dont know how to use it in a select dropdown..

<form ACTION="#" METHOD="post" name="test">
<select name="test2" onChange="openExternal(this.value)">
<OPTION SELECTED> -- Disabled -- </option>
<OPTION value="M:\filename.exe">Option 1</option>
</select></form>

thanks for help!

Old Pedant
12-16-2010, 07:28 PM
why would you use openExternal for <select> when launchApp works for <a>??

Did you try

<select onchange="launchApp(this.value)">

eyna
12-17-2010, 02:31 AM
Hi Old Pedant

I also have lists of External links (which I did not include in my post), not only the exe file.

Currently I am using <a> but in the new website, I would like to put all the external links and exe's in one dropdown list.

Thanks!

Old Pedant
12-17-2010, 02:54 AM
Ummm...that was NOT the point of my question/comment.

I was only saying that if the code launchApp('L:\\filename.exe') works for the <a> tag, then why would you not use the same JavaScript function--to wit, lauchApp( )--in the <select> tag???

Your code, other than that, makes perfect sense and should work.

eyna
01-07-2011, 04:10 AM
thanks.. yes it works in the exe's but not in other URL...

e.g., value="http://www.google.com"

my apologies, as I am not a real coder.. much on design. just found the launchinIE on net.

Old Pedant
01-07-2011, 06:14 AM
yes? It should NOT be used to launch ordinary URLs. It should only be used for launching ".exe" executable programs. Completely different things.

eyna
01-07-2011, 08:16 AM
so I cannot put the ordinary urls and the .exe into one <select>? is there any other way?

if none, I think I will just create a separate <select> for the .exe

Thanks so much!

Old Pedant
01-07-2011, 08:03 PM
Oh, you could do it with just a little bit of testing:

<select name="test2"
onChange="if(this.value.indexOf('.exe')>0)launchApp(this.value); else location.href=this.value;">
<OPTION SELECTED> -- Disabled -- </option>
<OPTION value="M:\filename.exe">my program</option>
<OPTION value="http://www.cnn.com">News</option>
</select>

thanks for help!

eyna
01-24-2011, 06:59 AM
great! thank you very very much! it works!

my apologies for my late response. we've been busy with the testing phase!