Tag: javascript events

JavaScript Event Listener for Text typed in Text Field/Area

Is it possible to use JavaScript to listen for text typed in a specific text-field, and then grab that text and save it to a string. Well, the latter (e.g., saving to string) will of course be possible if the former can be done. I found a Java Applet that does this (http://journals.ecs.soton.ac.uk/java/tutorial/post1.0/ui/textlistener.html), but I […]

Javascript “onClick” event doesn't work

I have this line in my php file: echo “<input type=’button’ id=’showButton’ value=’show’ onclick=’showOld()’>”; The button is displayed but when it is clicked, nothing happens. The function is located in an external JS file. this is function declaration: Other “onclick” events and JS functions in the page are working. function showOld() { alert(“njkh”); var table […]

JavaScript mouseout triggered when over children

I am working on menu to my website and I need to user over/out to show/hide submenu + animation. I got the following code: http://jsfiddle.net/JyTPW/ When I mouseover “products” and then go to child element, the mouseout is triggered. I tried to fix it but I failed. I read all the posts about checking the […]

JavaScript event listener firing when declared, and never again

I have a unique little problem. I have to show and hide a container, when a specific radio button is selected. Unfortunately my event listeners are being fired when declared, and not when the event actually occurs. Has anyone else run in to this sort of issue? <!DOCTYPE html> <html> <head><title>test</title></head> <body> <form name=”form”> <input […]

How do you find out the caller Object in JavaScript

I have var X={ method1 : function(){ A(); }, method2 : function(){ A(); }, } function A(){ console.log(‘im from methodNAME of ObjNAME ‘); } How can i find out the name of the method and Object that the function is calling from.?

Javascript – can you pause a form submission and then restart

Without using any JS libraries, is it possible to pause a form submission, run some code and then restart it ? Reason I ask is that I currently have a form that when it submits runs code that sends a request to my analytics provider. Works fine in chrome/IE but in FF and Safari there […]

Support for navigator.geolocation change event

It would be awesome to be able to attach a listener to a change in geolocation. I haven’t been able to find anything commenting on this either on w3 or searching elsewhere. Seems that its obviously not provided at the moment, but is there any planned support for this from any browser or any w3 […]

Firefox onkeypress event not passing in event parameter

I have the following textarea HTML tag that I am inserting a runtime into the DOM (I have only shown how it looks after it is inserted) and I’m set the onkeypress event to fire as an inline attribute. However, in Firefox I get an “event is not defined” error when I press a key […]

mouseenter event called twice even after stopPropagation

I’m new to jquery and am facing now a weird problem. I succeeded to narrow it down to the fact that a mouseenter event is called twice: once for the containing div (this was my intention) and again for elements within this div (not good). I tried to use ‘return false’ and ‘stopPropagation’ but it […]

2 buttons one form

<?=form_open(‘blog/register’);?> <table> <tr> <td><label for=”register_name”>Username : </label></td> <td><input type=”text” name=”register_name” readonly=”readonly” value=”<?=$_POST[‘username’]?>”/></td> </tr> <tr> <td><label for=”register_email”>Email:</label></td> <td><input type=”text” name=”register_email” readonly=”readonly” value=”<?=$_POST[’email’]?>”/></td> </tr> <tr> <td><label for=”register_password”>Password:</label></td> <td><input type=”password” name=”register_password” readonly=”readonly” value=”<?=$_POST[‘password’]?>”/></td> </tr> <tr> <td></td> <td><input type=”submit” value=”Register” onclick=”return true;”/></td> </tr> <tr> <td></td> <td> <input type=”button” value=”Edit” onclick=”window.location.replace(‘http://localhost/index.php?username='<?=$_POST[‘username’]?>’&email='<?=$_POST[’email’]?>’);return true;”/> </td> </tr> </table> <?=form_close()?> That is the form […]