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?
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.
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?
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;
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).
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.
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..
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
I need javascript to trigger the combination of ctrl + minus. Is it possible. I need this because the design of the webpage I'm working on is looking much better at 83 % zoom which couldn't be achieved by CSS zoom property in mozzila firefox.
The code I will am including is far from finished, but some of what I do have works (the "submit" code does not work yet). I am able to prevent certain kinds of input including Shift-Ins pasting, but Ctrl-v pasting still works (and I do not want it to). Could you please tell/show me what code needs to be entered to my existing functions, or what new function I need to create (and call from my existing functions) to eliminate any kind of CtrlKey input?
<code> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html>
I have a form where you can enter 1 player's data, press a button and that DIV gets cloned below with same ID names but numbers get augmented (ie firstName_1 in div player_1 becomes firstName_2 in player_2). My problem now is I have a Gender radio button and that if you fill out the gender question and then press the 'Add Player' button the checked status seems to disappear from the cloner div but is retained in the clonee div.
IE you can set gender_1 to 'Male' in div player_1 (checked with DOM inspector and console logging) but when stepping thru the code in firebug
I am using the JQuery tabs plugin and I notice if I have content in a tab that isn't active you can't search it if you press CTRL + F. Is it possible to be able to search a tab that isn't active?
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
I have a webpage with a form. Depending on user selections at the top of the page, the page will disable sections of the form. My plan is to put each section between a <div></div>. Each section contains some collection of form elements.
So if the user does not select some criteria, the related section of the form gets disabled. In a typical Windows type of application these elements get disabled and greyed out. What's the best way to do this in a webpage? Can Javascript determine what form elements are in a div section and disable these elements through a loop for example? I know I can disable each element if I know its it but is there a way to find out all the IDs of elements for some div section?
A form is up in the browser, user does what they need to do and hits "Submit". Being the patient soals that they are, they don't wait for the browser to refresh, but start entering more data / following links!
What I want to do is to disable all form elements and links when the user cliks "Submit". Anyone have some J-S to do this?
I saw quite a few scripts that allow the user to disable the right-click on certain components (usually images). This is what the code looked like (for IE);
function disableRightClick() { if (event.button == 2) { alert("Sorry, right-click is disabled"); return false; }}
Then call this function like so:
<a href="test.html" >
I would like to disable right-clicks without the annoying alert. I just don't want the menu to open when the user right-clicks the link. Is that possible? When I remove the call to alert, then the code has no effect.