onclick

How can I make an ActiveX control written with C# raise events in JavaScript when clicked?

I'm seeing a few questions related to this on SO already, but I think mine is sufficiently different to not be considered a duplicate (if I'm wrong let me know). I have an ActiveX control I've written in C# and while I have it mostly working, I want to raise an event in JavaScript when it's clicked (it displays an image so it's a visual...

Make onclick handler ignore clicks on links

I have a custom onclick handler for a block element (set up through jQuery's .click() method). This block element can contain links. I'm fairly certain this is possible, so, how do I have the handler simply return if it was a link I clicked on (so that the link is visited without running my code)? ...

Click Toggle with jQuery

I've used hover function where you do x on mouseover and y and mouseout, so I'm trying the same for click but it doesn't seem to work: $('.offer').click(function(){ $(this).find(':checkbox').attr('checked', true ); },function(){ $(this).find(':checkbox').attr('checked', false ); }); I want the checkbox to be checked when clicke...

ASP.Net double-click problem

Hi there, having a slight problem with an ASP.net page of mine. If a user were to double click on a "submit" button it will write to the database twice (i.e. carry out the 'onclick' method on the imagebutton twice) How can I make it so that if a user clicks on the imagebutton, just the imagebutton is disabled? I've tried: <asp:ImageBu...

Onclick function that mails page url to admin

I need to create some kind of JS onclick that will run a php mail script that emails a page with broken content. Would it be best to run a normal javascript onclick that calls a php file which is hidden, grabs the referring url and emails it? I would also like a message confirming the click, then disable it. Is there anything like thi...

How to execute two functions when a URL is clicked...

I have the following two event happening when my "export" url is clicked. No matter how I try, I can't combine the two without receiving a "hey, you're missing a comma or semicolon somewhere"-error. Can anybody suggest a way to combine the two, or should I just leave them separate as they are now? $('#export').click(function() { $....

img tag inside anchor tag, what to do when javascript disabled? how to capture click?

So I have add to cart button, which is comprised of an anchor tag that has an image tag inside it. The anchor tag is using a bunch of javascript effects for mouseover etc that does image swap of this image in question etc. Now, I have a function "AddCartButton" in my codebehind class that handles click event of this anchor tag. This obv...

Getting ASP.NET ImageButton OnClientClick changes to the server

I use an ASP.NET ImageButton on my website. When a user clicks on the ImageButton, a javascript is fired via the OnClientClick event. The script changes the ImageUrl of the ImageButton. On the same page, I have a submit button. Clicking the button causes a post back to appear. Is there a way of knowing the correct ImageUrl of the Ima...

innerHTML flash video not loading problem

Hi, when the "preview" link is clicked it is meant to change the video script and video swf using the innerHTML method, however in IE 7+ the flash seems to appear but never loads the video i.e. it just stays white. <script> function changeVideo(filename,script) {document.getElementById('video').innerHTML = '<object classid="clsid:D27CDB...

Send an onclick to a dropdown list

Is it possible to show the list of items in a dropdown list when the user presses the up or down arrow keys, when focus is on that dropdown control? I think this would involve sending an onclick to the dropdown list using onkeydown for Keycode 38(arrow up) & 40(arrow down)? But I cannot figure out how to do this. ...

maximum length onclick attribute in ie

Does anybody know if there is a length limitation for the onclick attribute in IE7? It seems that my onclick value is cut off after 259 chars. EDIT: Thanks for all your answers. It seems there is not limitation for the onclick attribute. There must be a bug somewhere in my code. ...

How to add click event to a iframe with JQuery

Hi all, I have an iframe on a page, coming from a 3rd party (an ad). I'd like to fire a click event when that iframe is clicked in (to record some in-house stats). Something like: $('#iframe_id').click(function() { //run function that records clicks }); ..based on HTML of: <iframe id="iframe_id" src="http://something.com"&gt;&lt...

jquery on click function

ok so basically I have this: <div id="tabs"> <div id="unique_id" class="tab_link" onclick="changeTab(this);"> <div id="tab_link_image" onclick="closeTab(this);"> <image src="image.jpg" /> </div> </div> </div> Now in the closeTab function I have it removing the tab from the page. In the changeTab function I have it toggling a ...

Add a marker to an image in javascript?

Hi, Anyone know how I can add a marker to an image (not a map) in Javascript? Ideally I'd like a handler that behaves much like adding a marker to a map - i.e. onclick causes a marker to be displayed at the point that was clicked, and returns the x/y pixel coordinates of the point that was clicked. Is this possible? Cheers Richard ...

Why does using target="_blank" cause Javascript to fail?

I have a bunch of links that use a target="_blank" attribute to open in a new window. I want to attach Google Analytics goal tracking to clicks of these links. To do this, I tried attaching an onclick="pageTracker._trackPageview('/event/outgoing')" attribute to the links. But I discovered that for links with a target="_blank" attri...

Downsides of onMousedown vs. onClick?

I've been dealing with a bane-of-my-existence Javascript problem involving tracking when a user clicks on a link (in case you're curious, here it is: http://stackoverflow.com/questions/1629158/why-does-using-targetblank-cause-javascript-to-fail). I've figured out that I can solve the problem by tracking an onMousedown event rather than ...

ASP.NET button says it can't find the method I put in OnClick

I have a log out button on my main menu and I want it to run a method to log out. However I want to store this method in a separate class as a static method, since this code may be called from other locations too. Compiler error message: CS1061: 'ASP.adminpages_masterpages_adminsystem_master' does not contain a definition for 'Extensi...

Resizing div after iframe change src...

So I automatically resize my iframe based on content height as follows: <iframe name="main" id="main" src="main.php" frameborder=0 scrolling="no" onload="this.style.height = main.document.body.scrollHeight + 5; this.style.width = main.document.body.scrollWidth"> However, I also use a link to change the src (utilizing target if anyone...

Android Dynamically Created Button: setOnClickListener doesn't work!

onClick never fires! Why not? Please help. for(int i = 0; i < 12; i++) { String title = "Button" + i; Button sliderButton = new Button(this); sliderButton.setText(title); glideMenuTray.addView(sliderButton,100,40); sliderButton.setOnClickListener(new View.OnClickListener() { ...

Handle the button onclick event in masterpage in ASP.NET MVC

I am working with master page in ASP.NET (3.5) MVC Framework (1.0). I am having one master page and 4 MVC Views in my application. I have placed these four views in the contentplaceholder of the master page. I have a Previous Button, a Next Button and the Submit Button in the master page. Now the question is: How to navigate between th...