Category "dom-events"

Document title won't stop blicking

I'm trying to get the document title to blink whenever there's an incoming message. I was able to get the title to blink properly, however the problem I'm runni

How to get the mouse position relative to the window viewport in javascript?

event.pageY gets you the mouse position relative to the entire document height(document.documentElement.offsetHeight I assume). But how do I get the mouse posi

What's the right way to enable the node debugger with mocha's --debug-brk switch?

I have some debugger statements in my module under test and want to run mocha with --debug-brk set and hit my breakpoint so that I can inspect the state of my m

JavaScript closure function not called on form submit

This has me perplexed. I have a textbox. You type something in, and press enter. JavaScript creates a read-only input element in separate form. Alongside the te

Validating Radio Buttons on Submit

I am trying to validate radio buttons on a competition, its multi-step so the radio buttons post the selection over to the entry form page. Currently having tr

How to make a real "onchange" event in HTML (no jQuery)?

Please note: I do not want to use jQuery for this (otherwise I like it) Problem: I have come to situation where I need to do some javascript function after an u

HTML input type number JavaScript onchange fires twice?

I can't believe I couldn't find any discussion on this already... There have been questions of how to handle events from the HTML5 form element <input type="

Feeding JavaScript variables into form fields on submit

I've got this almost working but can't quite complete it. I have a jQuery datepicker on a reservation page that feeds into an "Arrival" field as mm/dd/yyyy. I a

Reflect select state in JavaScript function

In JavaScript how do you make it so that a function is ready to change at any moment? I want to make it so that when someone selects a different option from a d

Cancelling JavaScript events in IE11

I have some historical code that's using event.returnValue = false to prevent CR from causing a post back in an ASP.NET via the onkeydown event: onkeydown = "if

Form value to be empty if no change by user

I have a form with two inputs: <input type="text" name="keyword" value="Search" onfocus="wipe(this)"/> <input type="text" name="city" value="City" onf

Form value to be empty if no change by user

I have a form with two inputs: <input type="text" name="keyword" value="Search" onfocus="wipe(this)"/> <input type="text" name="city" value="City" onf

Submitting forms using JavaScript

I have been battling for the past two days with the evil onbeforeunload function in JavaScript. I have a function that warns the user when they are about to clo

How can I react to 'onchange' and 'aspx state' information for a form dropdown?

I'm after what seems to me to be a straightforward pattern for handling page refreshes when I've got a drop-down that reacts to the onchange event. I've used th

onKeyUp event calculation not working on the following rows from php generated forms except the first one

-------------------------------------------------- |No|Style No|Item Desc|Qty|Unit Price|Total Price| ----------------------------------------------

Javascript validate form is not preventing submit

I have a form and I do JavaScript validation function onsubmit: <form method="post" onsubmit="return validateForm(this.id)" action="<?php echo $PHP_SELF;

How to check multiple function in JavaScript

I have many functions written in JavaScript such as userName(), password() etc. But on submitting on the form, I have a single function return formValidator();.

In ASP.NET, After Selecting "Stay On This Page" nothing is working

I am using this code for preventing user to leave the page if there is any changes on the form in SharePoint FarmApplication <script> var formDirty

Replace traditional event call with JavaScript event listener

With the following code: <head> <script type="text/javascript"> function popupMsg(msg) { alert(msg); } </script> </head> <body>

Fire Button click event during onsubmit

I want to fire a click event during the onsubmit of form. In button click event I used a url which it has to redirect. I don't want to use the form's 'action" t