Category "dom-events"

How to differentiate between JavaScript submit and manual submit (for forms I don't own)

My question is almost the same as this one. But I have to ask the question again because I can not accept the answer that the OP there has seem to accept. I l

Javascript firing function twice and 1 of 4 functions not working

I'm creating a calculator in JavaScript. It is working, except for the add() function (sub, mult, and div work fine) and when I press "=" it sends the answer t

How can setTimeout save and load data back to form inputs if browser crashes, and I visit that same page again?

How can setTimeout save and load data for select form inputs? I tried to get it working with event listeners. I checked the capture and bubble which I am still

JavaScript code displaying in browser when form submitted, not the result of the script

I'm writing a basic calculator in JavaScript, and when I hit "=" on the html form it is returning the entire calculator.js, not the result. I'm not sure why th

How to attach a keyup event to Custom Element shadowRoot

I have searched for some time; but only find Polymer answers; or answers where EventListeners are put on DOM elements inside the shadowRoot. The effect I am try

In HTML, with JavaScript, create new radio button and its text?

I want that when the "Yes" radio button of a form (form1) is checked, a new form (form2) appears, with two radio buttons and their text "Yes" and "No". With an

Moving a value into an html form field

I am very new to JavaScript and would like to know how to go about the following. I have a form that I am using for entry to a fishing contest. It contains fiel

My button needs to update after an input field

I have the following problem, I made a form using HTML with some input fields. I also made the submit button disabled using the following JS code: if(document

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