Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7914345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:04:58+00:00 2026-06-03T14:04:58+00:00

Observe fields on a form and report changes I have now written a simple

  • 0

Observe fields on a form and report changes

I have now written a simple utility (part of the observer pattern) to observe the changes made in each field of a form.

var idInt = setInterval(function() {
  // each input is a document.getElementById(id)
  var len = inputList.lenght;

  while(len--) {
    //send value to somewhere
    someWhere(ininputList[len].value);
  }
}, 40)

but i have issues like:

  1. when change the value with mouse (cut/paste)
  2. when change the value programmatically

the value take by someWhere(ininputList[len].value); dont refresh even I tried to add events (onchange, oncut, onpaste, oninput, onkeyup) to the elements to avoid setIntervalloop but with the events when i try to change programmatically the values dont fires.

which would be a better approach to observe changes in the values ​​of elements (input [button | text | password | url | email], radio, checkbox, select) taking into account that programmatic changes monitorizen and changes through the interface user,

Note: I am looking for a raw solution, no jquery, prototype, js class or any framework just native javascript

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:04:59+00:00Added an answer on June 3, 2026 at 2:04 pm

    I am not sure what is the problem because below code works

    setInterval(function() {
      var inputList = document.getElementsByTagName('input')
      var len = inputList.length;
    
      while(len--) {
        console.log(inputList[len].value);
      }
    }, 4000)​
    

    It prints changed values every 4 secs, you can see it in action here http://jsfiddle.net/QKqzT/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to observe changes in multiple form fields and make a call
Input rz value In the head I have: Event.observe(window, 'load', function() { $$(input).each(function(field){ Event.observe(field,
I have two sets of radios: <div class=form-row> <div class=field-label> <label for=part><span class=style37>Participated</span></label><p class=aste>*</p>
I have an "Add Person" form with a few fields (name, address, phone number,
Is it possible to observe (subscribe to) changes to values stored under different keys
It's simple to observe the documents scroll event but I can't seem to find
Our webapp has a form with fields and values that change depending on values
I have a form that has two field (time_selects), the idea is that the
I have a form. I am trying to validate it through AJAX GET requests.
I have an event form with some nested attribute models. The additional models are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.