467,077 Members | 1,046 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

Right-click context menu that can pass values when right-clicking a link??

Is it possible?
Say

We have a list of suppliers link like

A supplier
B supplier

when right click on a supplier, a context menu(that has
"details","view products", etc) appears and click on "view products
for this supplier" this click will redirect users to products page
showing all products from the supplier.

So href should look some like this
<a href="RightClicked('10')">A supplier</a>

<script>
function RightClicked(supplierID)
{
// don't know I am making this up here
if (viewDetailsClicked)
ShowDetails(supplierID);
else if (viewProducts)
ShowProducts(supplierID)
etc
..
}
</script>

Can it be done, does anyone have the script?

Thanks a lot
Jul 23 '05 #1
  • viewed: 1599
Share:
3 Replies
Leon wrote:
Is it possible?
Say

We have a list of suppliers link like

A supplier
B supplier

when right click on a supplier, a context menu(that has
"details","view products", etc) appears and click on "view products
for this supplier" this click will redirect users to products page
showing all products from the supplier.

[...]

Wouldn't normal menus and hrefs to the trick? If not, how about
dynamic HTML (DHTML)? This is what they are intended to be used for.

The ability to modify the right button menu is limited to a couple of
browsers: not everyone has a right button and even if they do, they may
not be able to use it (think of someone who is disabled).

If your application is for a strictly controlled intranet where you can
guarantee a suitable platform, you may be OK. But for the general web,
you may be locking out 20% to 50% of potential visitors.

--
Rob
Jul 23 '05 #2
Leon wrote:
Is it possible?
Say

We have a list of suppliers link like

A supplier
B supplier

when right click on a supplier, a context menu(that has
"details","view products", etc) appears and click on "view products
for this supplier" this click will redirect users to products page
showing all products from the supplier.

So href should look some like this
<a href="RightClicked('10')">A supplier</a>


PS. As a hint to how dreadful Microsoft's on-line documentation is,
here is a snippet of their effort to provide a demo of DHTML
menus:

<SCRIPT LANGUAGE="JavaScript"><!--

/* ----------------------------------------------------------------
sniffing code to detect for IE4 on either Windows NT or 95
---------------------------------------------------------------- */

var sAgent = navigator.userAgent
var bIs95NT
= sAgent.indexOf("Windows 95") > -1
|| sAgent.indexOf("Windows NT") > -1
|| sAgent.indexOf("Win32") > -1
|| sAgent.indexOf("Windows 98") > -1
var bIsIE4
= sAgent.indexOf("IE 4") > -1
&& sAgent.indexOf("b1") <= -1
&& sAgent.indexOf("p1") <= -1
var bIsIE432 = bIs95NT && bIsIE4

/* ----------------------------------------------------------------
variable declarations for doMenu
sOpenMenuID points to any open pop-up menus, is blank otherwise
---------------------------------------------------------------- */
<URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndhtml/html/popupmenu.asp>

You may note that their own demo code excludes 95% of current web
surfers! That is, anyone not using Win32/95/NT with IE 4.

Good for a giggle but that's about it.

--
Rob
Jul 23 '05 #3
Thanks for your reply.
Yes, this is for intranet.
Do you have any script for that?
I am not very familier with DHTML.

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Frederik | last post: by
3 posts views Thread by - Steve - | last post: by
10 posts views Thread by Sender | last post: by
1 post views Thread by Adam Clauss | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.