Category "dom-events"

JavaScript IE double submit with form.submit()

I am experiencing difficulties with IE (8, 11) double submit which is triggered by JavaScript code: this.disabled=true; form.submit(); return false; Sentence

Javascript/DOM event name convention

When I started doing web development, I realized Javascript event names were all in lower case with no separators, i.e. "mousedown", "mouseup", etc. And when wo

View selected values of a form

I'm trying to view the value selected in a radio button. The form is: <form onsubmit="return false;"> <fieldset> <h3>Textos</h3> <la

Why on IE 8 that a change event on input is not propagated to the form element?

I thought a change event would propagate from the input element to the form element in general? On Chrome, it works: http://jsfiddle.net/gjatW/13/ But on IE 8

Make a button inside an element clickable while the element itself is also clickable

I have a simple sidebar, that has a bunch of list items in it, and a button right next to the list item, like so: I attached a click handler to the <li>

HTML forms validation with a FILE input object

I've been pulling my hair out trying to add a FILE input object to a form on one of my intranet web pages. I saw this article (HTML <input type='file'> F

Where to add onsubmit to a form in Javascript

In my HTML I've got a form without an onsubmit event listener: <form action="contact.php" method="post" id="contact"> ... <input type="submit"

Toggle between a textbox and a select using PHP

I have a basic customer information form that I would like to make a little more interactive. The idea being if the user selects a country that is not USA or C

Stop a form after it has submitted

Just like the question asks, is there a way to stop a form after it has been submitted? This is not a 'how do I validate' question. I cannot call a function and

Express item.parentElement.remove() in a way that is supported by IE

From what I understand, the remove() function is not supported in IE. I have a JS function that creates a div and appends it to an existing list.The div contai

JavaScript this.form returns unexpected form

I got some enclosing form and two nested forms. the two nested forms are evaluated with ajax on buttonclick and the external form has a submit-button. Simplifie

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