Disable A Function When Ctrl Or Cmd Is Pressed?

May 28, 2011

I want to disable a function when a user is pressing control or command using Javascript. Is this at all possible? My reason for doing this is because I recently implemented lightbox to my script, but I still want users to be able to open the image in a new tab by just clicking control or command when clicking the image rather than opening it in lightbox (which it does).

View 1 Replies


ADVERTISEMENT

Capture Event When Ctrl Key Is Pressed

Jul 20, 2005

I want to capture the event when the <ctrl> key is pressed.

View 3 Replies View Related

Events With Shift, Ctrl Or Alt Key Pressed?

Oct 14, 2010

This is a proof of concept question ... that I've been unable to prove. Ultimate goal to is allow one button to have different actions with the Shift, Control or Alt key pressed for a link "<a...>" or a button ("<input type='button'" or "<button>.") click. The following appears to work in FF and MSIE on PC (with some side-effects), but not at all on a iMac using FF or Safari.

The display in the textarea shows that I can detect when the Shift, Control or Alt keys are pressed and an event is created with a mouse click. With a left mouseClick, the display shows

[Code]...

View 2 Replies View Related

Disable Ctrl + F In The Browser

Oct 11, 2005

Can I disable the ctrl + f funtionality in the browsers?

View 3 Replies View Related

Disable Submit Buttons If Enter Is Pressed?

Jul 22, 2010

I have form within a form and I would like to disable the submit button in the inner form.Currently I have this for some other forms, and it works just finePHP Code:

<form method="post" action="index.php" onkeypress="return event.keyCode!=13">
<input type="text" name="first" value=""  />
<input type="text" name="last" value=""  />

[code]....

View 9 Replies View Related

JQuery :: Bind A Function To Ctrl+Q?

Nov 8, 2011

Using jQuery, how do I make a function to execute when users press Ctrl+Q? Or other combinations of Ctrl and a key.

View 3 Replies View Related

When The User Clicks Tab+ctrl To Go Back The Function That Is Called Is The Onblur Instead Of The Onkeypress?

Jul 17, 2009

I'm creating a dynamic site but now I'm coming across a problem when I'm displaying input textbox.The textboxes uses two events onblur and onkeypressThese two events they invoke the same function which suppose to determine the function must be executed between Shownext() and tabbackorFront()When a use uses tab key to go or display the next select dropdown it functions well ut when the user clicks tab+ctrl to go back the function that is called is the onblur instead of the onkeypress.What I need is the way at which the events are called when tab+ctrl is clicked to go back

View 6 Replies View Related

Multiple Function Call When Submit Is Pressed

Dec 28, 2011

i m trying to call multiple function when submit is pressed.i have tried wrapping the functions as well as onsubmit="return validateForm() && checkdate(mydate)"my 1st function is validating if all the columns in the form are filled or not AND.my 2nd function is validating date text box in my form....i m not able to call multiple functions onsubmit [code]

View 1 Replies View Related

OnkeyDown Function - Store Key Pressed In Variable

Feb 24, 2010

I want to use an onkeydown() on my web site and the web site to know which key I pressed. Specifically know I pressed the arrow keys and store which key was pressed in a variable. Must work on all browsers.

View 1 Replies View Related

How To Make A Function Only Run An Image Button Is Pressed

Apr 4, 2011

This is from long complicated code so I can't show everything but how do I make the function only run if an image/button is pressed?

At the moment everything works properly in Chrome, FF and Safari just not IE. code...

View 2 Replies View Related

JQuery :: Function - Element Is Clicked While SHIFT Key Is Pressed

Mar 24, 2009

i am trying to build a function that takes into account a click event and SHIFT key press event on a particular element.

so for example, i want to do something only when i click a box WHILE pressing the SHIFT key.

how do i program this using jquery?

View 4 Replies View Related

For Loop - Execute Function() When Submit Button Within Form Has Been Pressed?

Oct 18, 2009

[Code]...

1. What is the benifit of having the above code with "window.onload" and "for loop" and loop through the forms if I only have ONE form in html?

2. What is this line of code "document.forms[i].onsubmit" saying? Does it mean "Execute function() when submit button within form[i] has been pressed?"

3. function() - Does this empty function mean "run every following function below"??

View 2 Replies View Related

JQuery :: Toggle Function - Hide/show Table When Hide/show Button Is Pressed

Sep 12, 2011

I am trying to hide/show table when hide/show button is pressed

Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.

Code:

View 1 Replies View Related

Disable Function Key F1?

May 3, 2005

I USE THIS CODE TO DISABLE FUNCTION KEY, ITS WORK PRETTY EXCEPT F1. [code]...

View 12 Replies View Related

Capturing Ctrl N

Jul 23, 2005

Is there any way to capture the action Ctrl+N (whether it in a hidden
button or keyword - doesn't matter) in html, javascript or php?

View 6 Replies View Related

Detect CTRL + V

Jul 23, 2005

How can I detect the press of CTRL + V in an input of type text?

View 4 Replies View Related

Disabling CTRL-N In IE7

Apr 24, 2009

I am using the following code for disabling Ctrl-N in IE7. It disables the Ctrl-N feature of IE which opens a new window containing the same page as the 'active' window. The code works great (at first glance). However, I noticed that, if you click anywhere inside the browser window and THEN press Ctrl-N, the new window will open. If you don't click anywhere inside the window, the following code works. Can anyone see an improvement to the following code so that clicking inside the browser window doesn't bypass the javascript?

View 2 Replies View Related

Use A Checkbox To Disable A Function?

Jan 29, 2011

Actually, the subject pretty much is the question, but if you want more detail, here goes code...

pans and zooms the map when the user selects a line, which is really useful about 95% of the time and kind of annoying 5% of the time. So I was thinking it would be good to give them the option of disabling that function for the 5%.

the function gets called from a couple of different places in the code, so for neatness' sakes it would be nice to have something within the function above that checks for the checkbox state before executing. but some kind of if/else where the function gets called would be ok, too..

View 2 Replies View Related

JQuery :: Using The Selector With The Ctrl?

Jul 6, 2010

I would like to bind a set of data inside a repeater and be able to use the selector to select 1 or more then 1 values?

View 8 Replies View Related

Move From Onelist Box To Another Using Ctrl Key?

Apr 16, 2009

I am working on copying from one listbox to another. The value should not be removed from first list box. I am trying to select multiple values using ctrl key for copying. can someone give some idea or sample code for this.

View 6 Replies View Related

Getting Ctrl Key Without Click Event?

Jan 23, 2011

I am writing a callback functions that fit into a framework. Unfortunately, the framework does not provide any means of getting the initial onclick event. So, I tried doing the following to see if the ctrl key was pressed:

var ctrl=(window.event&&window.event.ctrlKey);

This didn't work. Is there a way to know if the ctrl key was pressed after the fact?

View 1 Replies View Related

Allow Use Of Ctrl-D WITHOUT Native Menu Coming Up

Dec 15, 2011

I would like to do this WITHOUT jQuery.

I have tried to get an event listener to listen for when the user presses Control-D on their keyboard. This would trigger a confirm delete function - if you've ever used QuickBooks Ctrl-D is the command that does this and this is a financial application.

Problem is that in FireFox, Ctrl-D means bookmark the page and this window pops up. I want to "return false" before this happens.

On this subject I would also like to take over Ctrl-C and Ctrl-V eventually but with Ctrl-D it will work for anything. here is what I have. Again, IT WORKS, but doesn't stop the natural event (bookmark page) fromhappening:

Code:

function AddOnkeypressCommand(strCommand){
//---- version 1.0, by , last edit 2004-12-14
//add to array of commands:
m_onkeypressCmds[m_onkeypressCmds.length] = strCommand;

[Code].....

View 2 Replies View Related

Prevent User Using Ctrl V To Paste?

May 22, 2011

I wish for my users to retype their email address instead of the copy and paste method to ensure they have typed it correctly both times.

How could this be done, would it be Javascript ?

View 6 Replies View Related

How To Capture CTRL+SHIFT+P At Same Time??

Oct 27, 2006

I'm working on controlling a windows media player I'm trying to figure out how to control it with keys like CTRL+SHIFT+P to play it. The problem is that I don't know how to capture all three at the same time.

I'm ONLY supporting IE because that's what the client only want's supported. I have been reading through the forums but nothing about capturing both CTRL+another key or SHIFT+another key.

View 2 Replies View Related

Increasing The Page Size (like Ctrl+)

Jan 13, 2010

I have used javascript to change text size before however the task i wish to try is a little bit out of my league, i have scoured the web looking for an answer and have yet to come close to anything similar. This is sort of a last option for me so i truly hope i find a clue or better yet an answer. Essentially what i am trying to achieve is exactly the effect achieved when you hit "ctrl+" to increase the size of a webpage so that i can include a button/link etc that can be clicked for users with lesser vision so i can avoid going back into any of my clients completed sites and having to completely redo the css/overall design..

View 2 Replies View Related

Possible To Do A CTRL-z (undo) In On-click Event

Sep 29, 2010

is it possible to do a CTRL-z (undo) in a onclick event ?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved