473,372 Members | 1,244 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,372 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 1869
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.