onChange event w/ text boxes - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

onChange event w/ text boxes

FSUKXAZFSUKXAZ Posts: 26Member
I am trying to something with an onChange event and I am stuck. This is the scenario: Information is being filled out in a set of text boxes in a table on an onChange event. That's great and it works. Now I have to make another set of text boxes on the same page in a different location, and have them print out the same results (so people don't have to scroll all the way over to see the results). How do you print out the same results in the new set of text boxes?

Initially I copied and pasted the code from one area to the new area, but then the informtion was only being printed out in the one location and not both. I'm being told to use an onChange event to get it to work.

Comments

  • bgibbybgibby Posts: 251Member
    : I am trying to something with an onChange event and I am stuck. This is the scenario: Information is being filled out in a set of text boxes in a table on an onChange event. That's great and it works. Now I have to make another set of text boxes on the same page in a different location, and have them print out the same results (so people don't have to scroll all the way over to see the results). How do you print out the same results in the new set of text boxes?
    :
    : Initially I copied and pasted the code from one area to the new area, but then the informtion was only being printed out in the one location and not both. I'm being told to use an onChange event to get it to work.
    :

    Hi there,

    I think you're on the right track, this is what I would do...

    [code]





    function dupeText(srcTextBox, destTextBox) {
    var src = document.getElementById(srcTextBox);
    var dest = document.getElementById(destTextBox);

    dest.value = src.value;
    }









    [/code]

    Even better, use the onKeyUp event. This changes the text with every Keystroke!

    Hope this helps!
    Bradley q:)

Sign In or Register to comment.