javascript-events

Two button submit breaks other events on page (mootools).

I am wanting to use two button form and created the following which works. It however breaks any other events on the page but I can't figure out why. Is there a better way? window.addEvent('domready', function() { $('vote1').addEvent('click',function() { new Element('input', { 'type':...

jQuery Event.Target Problem

I don´t know if I have forgotten how to do so or if it´s a bug, but I just can´t find the caller's reference using jQuery. I´m doing the following: $(document).ready(function() { $('#parent a.item').click(doSomething); }); function doSomething(e) { // Alerts for demostrational purposes only alert(e.target); alert(e.cu...

Can someone explain how to get an object position from the RIGHT?

Hello all, I'm doing a drag and drop module now, and I need to get the position of the element on screen (don't really care if it is page, screen or offset or any thing else), but it has to be from the right as my project is in a RTL language....everything is RTL, so the data has to be saved like that to the DB because resolution and re...

How to remain the selected navigation selected after it redirects to another page?

Hi! I'm using one index.tpl with navigation menu. Once the user click on the menu, it will direct to another page. The problem is, the selected menu is not in the selected state once it redirects to the new link. If there a way to keep the menu in the selected state even after it links to another page?? Thanks! ...

jQuery UI toggle button events

How do I bind events to a jQuery UI Toggle button? More specifically, how can I bind events that are going to fire? The checkboxes are rendering to toggle buttons correctly, but any event handlers attached to them are not triggered when the state of the button changes. Is there something I'm missing? CSS: <input type='checkbox' id='...

RoR + How to refresh javascript value when Ajax refreshes the textbox value

In my webpage, I am using ajax + RoR to refresh the contents of the textbox using searchtool. All the value i am accessing, such like superset value for the current page. Means for example there is headquater and it has many stations. When I am trying to access the value of headquater at station then corresponding values changes at textb...

Submit Event Listener for a form

I've written an event listener for a form submit that is causing me a few issues. When pressing 'enter' inside the text field everything works fine. However, I have an span (with background-image) that submits the form as well via a click event. This is not working properly and I can't figure out why. Here's the basic HTML: <form name...

Image onclick event for calling function is not working for FF and Chrome..

Hi All I have a div section in which i have an image whose onlick event should execute a function called in it, but it is not executable in FF or chrome with my code, infact the image is not clickable at all . Could some one help me in get the thing done? below is the code i am working with <div class="addtocart-popup-bg"> <div ...

Why Javascript global variable is not global?

I have a external js file handling deleteing some element. According to the result, I would determine whether I need to refresh the page or not. var deleted = 0; // first assume not deleted $(function() { $("#action a.action-delete").click(function() { var id = $(this).parent().parent().attr("id"); $.get("modify-s...

What does this error mean in Firebug?

Possible Duplicates: Firebug JS warning to jQuery 1.4.2 The 'charCode' property of a keyup event should not be used. The value is meaningless. To ignore it? Firebug: The 'charCode' property of a keyup event should not be used. The value is meaningless. I have this error when I start typing on my textbox: The 'charCode' ...

How to capture the destination url in onbeforeunload event

I want to use onbeforeunload to give a message to users before leaving certain pages. Is it possible to know which url they are supposed to jump to at the onbeforeunload event? Thanks ...

Is there a way to tell how much of an image is already loaded?

Is there a way to know how much percentage of one image is already loaded? Kind of a onProgress event for the load? So if I would do something like this $('<img/>').load(function(){ $(this).appendTo(some div); }) .error() .attr('src',some source); I could have some progress bar indicating how much of the previous load is complete....

jQuery - Fire a function on a element

Hi I need to add a color picker to some input elements. I'm using $(".element").colorPicker(){ ... } This works perfectly. The problem is that the page has a AJAX form, which - when submitted - will overwrite the previous form with a new one (new input fields etc). After that the colorPicker stops working. So how can I fire that fun...

Opera onkeyup broken? Repeats, fires while down

When I add any onkeyup event, it does not do what it's supposed to in Opera. It fires repeatedly while the key is held, not when it's released. This same event works correctly in Chrome and Firefox. I have no listeners for keydown or keypressed. This simple code logs a stream of key events to the console in Opera when the key is held do...

Making onpropertychange and domattrmodified work to detect when elements are changed

Something should trigger, no? I get not supported in IE8 and nothing happening in Fx 3.6.10 <html> <head> <script src="http://code.jquery.com/jquery-1.4.2.js"&gt;&lt;/script&gt; <script> // modified from http://pragmatec.blogspot.com/2009/06/google-toolbar-style-and-tooltip.html jQuery(function($){ $.fn.dommodhandler = function(opt...

A mouseover button in a post starts blinking?

I have two div-elements where one representing a post(status post) and one representing a delete-button for deletion of the post. The delete-button shall only be shown on mouseover event of div-element representing the post. It shall also be shown on mouseover event of the delete-button itself, because it lies within the post. document....

how to fire code in case of a success or failed form validation with jquery validate

hi there, it seems that jquery validate plugin does not come with out of the box, success and failed callback options. how do i manage to launch some custom code when a form's validation fails? we need to change certain layout elements not related to the fields itself when a player enters invalid data. hope it is still possible ...

How tofind the textbox position using javascript

Is It Possible to get the text box position using the javascript ...

Regular expression for url matching

Hi All, I have a text field have value http://localhost/Send/test.php?s/?a=1&amp;o=2 . Another three text boxes . If we enter three values the above url will change like http://localhost/Send/test.php?s/?a=1&amp;o=2&amp;s1=a&amp;s2=b&amp;s3=c . The value for s1,s2 and s3 will not save anywhere . My question is how we check is the value ...

Google Chrome touch events not firing

I'm building a touchscreen kiosk using Chrome (7.0.536.2 dev) in kiosk mode on a Windows 7 PC with multi-touch display. I can see that the ontouchstart event is available (by inspecting the window object in Webkit Web Inspector) but it never fires. If I write the following code, the onclick event fires when I touch the screen but the on...