javascript-events

setTimeout(fn(), delay) doesnt delay as expected

hi all I must be missing something quite obvious here because something rather strange is happening I have a bit of js code that goes pretty much like this setTimeout(myFn(), 20000); If I m correct when I hit that line, after 20 seconds myFn should run right? in my case myFn is an ajax call and it happens quite fast ( not at 20sec...

Listen for Events from Browser "Find" Window in JavaScript

Is there a way to listen for typing into the browser's "find" window in JavaScript? I'd like to be able to reinterpret the search text from JavaScript. What do I need to add an event listener for? ...

jQuery replacement for onclick

Hi Everyone, I've just recently discovered the power of jQuery. Just a quick question though. What is a replacement for onclick="DeleteSomething('THE ID NUMBER LOADED IN BY SERVER SIDE')" ? Is there even a way somehow to pass custom information such as an ID to a jquery onclick? Or do i have to stay with the old fashioned way? Than...

JQuery accordion - unbind click event

I am writing a form wizard using JQuery's accordion module. The problem is I want to override any mouse clicks on the accordion menu so that the form is validated first before the accordion will show the next section. I have tried the following: $('#accordion h3').unbind(); $('#accordion h3').click(function() { if (validate()) { ...

properly bind javascript events

Hello. I am looking for the most proper and efficient way to bind javascript events; particularly the onload event (I would like the event to occur after both the page AND all elements such as images are loaded). I know there are simple ways to do this in Jquery but I would like the more efficient raw javascript method. Thank you ;) ...

jQuery disable form element when checkbox is checked

I have a complicated jQuery form and I want to disable several form elements if a certain checkbox is checked. I'm using jQuery 1.3.2, and all the relevant plugins. What am I doing wrong here? Thanks, Dakota Here is my HTML: <li id="form-item-15" class="form-item"> <div class='element-container'> <select id="hou...

simulate the tab key function in javascript

Hi Friends, I am having a form with lots of entries. I would like to change my focus to the next textbox, once i entered the value in the current textbox. and want to continue this process upto the last field. My question is, is it possible to simulate tab key through javascript coding once i enter the value in the text box. Without pre...

How can I capture the enter key in Firefox 3.5 and redirect the page using Window.Location?

I am trying to implement a search functionality that is capturing the enter key and redirecting to a different page in an ASP.NET 3.5 application. Unfortunately it does not work in Firefox (version 3.5) but in IE it is working perfectly. Please see the following code: Script: function searchKeyPress(e) { if (window.event) { e = windo...

obtaining the value of a select dropdown from within a function

I have a method of an object called update that generates an integer, and if it's different than the value of the region variable, assigns it to region. If the integer is the same as region then the user selects a value from a <select> dropdown menu. I'm trying to figure out how to get the value of the <select> into the function. <for...

Javascript form validation.

Hi, I am doing some basic form validation. I have the following javascript function function fullField(x,span_id) { var result=false; if(x.value==0) { document.getElementById(span_id).innerHTML =" Required"; result=false; }else{ document.getElementById(span_id).innerHTML="";//can use tick <img src='images/site_images/tick....

Trouble determining onclick's target

I've tried and tried... and I can't seem to make this work in IE (tested version 6) Can anybody help me? IE complains about an error but refuses to tell which error it is... var a = document.getElementsByTagName("a"); for (i = 0; i < a.length; i++) { if (a[i].getAttribute("class") == "info-link") { a[i].onclick = function(...

Image Upload -- showing image on web page before hitting Submit

To better learn web development, I'm trying to write a PHP page that will let me upload and download files from a server, which I've done in ASP before. I am however, tripping over something that reason says should be simple, but I'm not able to find an answer for it. Here's the pretty standard code for the browse/submit: <form enct...

Clicking a link when enter key is pressed using jQuery

I'm trying to make it so when a user is in a text box and they press enter, it is the same as clicking the link, in which case it should take them to another page. Here's what I have and it doesn't work. The code //jQuery $(document).ready(function() { //if focus is in the input box drivingSchoolInput $("#drivingSchoolInput").li...

subsequent click eaten on img inside anchor tag, firefox 3.5.5

Hi, given the following test: http://snipplr.com/view/23898/ I have a series of pages with 96x96 thumbnails in the same spot and I want people to be able to continuously click the thumbs. I'm seeing weirdness in Firefox 3.5.5... if you don't move your mouse AT ALL after clicking the red box once, (after the page reloads) when you clic...

How to solve - DIV element flashes/disappears immediately after it is rendered.

Here's what is happening After the page loads, javascript reads an XML from the underlying code The XML contains a bunch of field-ids, and corresponding content to display in popups when the mouse hovers over a field id listed My code generates a bunch of popups as div-elements with the styles .render{ background-color: #fffc80;...

Attributes.Add Onclick Event in c# code behind

Hello all. I have two textboxes tbxProdAc & txtbxHowMany. I would like to write a bit of code in the code behind so that when I enter text in one, any text that may have been in the other is removed. How would one go about achieving this and in which event should I place it? I have tried to use txtbxHowMany.Attributes.Add("onclick"...

Can I flush the event stack within Firefox using Javascript?

I have a hierarchy of tags within my HTML which all contain onclick event handlers. The onclick is pushed onto the event stack from the leaf back through the root of the hierarchy. I only want to respond to the leaf onclick event. Can I flush the event stack rather than using a flag? For instance... <ul> <li onclick="nada(...

How to trigger Mouse-Over on iPhone?

This might seem like a really dumb question, but I am writing an application and I have come across where my mouse-over, mouse-click and mouse-hover need different events bound to them. Now on Internet Explorer, Firefox, and Safari. It all works as expected. However, on my iPhone the actions will not trigger. Now my question is are the...

how can we perform reset function in master page of aspx page?

function reset1() { alert("123"); document.form1.reset(); return false(); } i want to reseting controls of master page.. using javascript but.it doesnt word properly.. can anyone help me to get through... Above is the function of reset which i used..for reseting.....

Help registering an event listener on an element

This is the structure of HTML. I have to add an event listener when user click on div with className "next_button". I try to add an event listener by using prototype. <div id="horizontal_carousel2"> <div class="previous_button"></div> <div class="container" > <ul> <li></li> <li></li> <li></li> <li>...