Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.