473,326 Members | 2,182 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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
3 1862
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Frederik | last post by:
Hi all, I'm trying to extend the context menu that appears when right clicking a folder in Windows Explorer. I've seen some examples in C++ (not .NET). Since C++ is not (yet) my cup of tea, I...
3
by: Marcel Hug | last post by:
Hello NG ! I would like to show the context menu which apears when i drop a file by fight mouse button. Could somebody help me ? Thanks
3
by: - Steve - | last post by:
I have a website where I use forms based authentication. There's a couple links in there that go to another website that uses basic authentication. How can I pass the credentials of the logged...
10
by: Sender | last post by:
I wrote about this yesterday...and many people advised the solution. But it didn't work. Let me put it again: I have a form with just command button. Then I inserted a context menu...
3
by: Just Me | last post by:
I have a usercontrol on which I have, say, five controls. I want a context menu to popup when the mouse is clicked anywhere on the userconttrol. The same context menu. What I've done in the...
3
by: hzgt9b | last post by:
Using VS2005, VB.NET, I am developing a windows app that has a DataGridView. I want to enable the display of a context menu on this DataGridView only when a specific set of keys is also pressed...
19
by: BibhuAshish | last post by:
Hello, I have created a context menu in mozilla by using following code: function nrc(e) { var contextMenu; document.oncontextmenu = function (evt) { var srcElement; if (evt &&...
1
by: sss123456 | last post by:
Hi, i have a iframe and calling a php inside that, and the is a conext menu by which i'm perfoming task to set colour of selected text on diif conditions. this is working fine in IE, but in...
1
by: Adam Clauss | last post by:
I have a ListView (in 'details' view) to which I added a ContextMenuStrip (using the designer). This is all good, except that the context menu also appears when I right click a column header - I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.