1 Reply Latest reply on Jul 11, 2007 10:06 AM by Hal B. Helms

    update textbox by selecting a different row

      It's like a messaging app so when you click on the selected message title, the text shows in the textbox. Well, I've got a nice list of message titles but what is the trick for updating the textbox to reflect the message chosen? I can do this with separate pages but that seems silly. I imagine this is something to do with an onclick handler but can someone point me to an example?

        • 1. Re: update textbox by selecting a different row
          Hal B. Helms
          Hopefully, this will get you started:

          <style type="text/css">
          display: none;
          <script type="text/javascript">
          function display(anElement){
          var number = anElement.id.split('-')[1];
          document.getElementById('message-text').value = document.getElementById('message-' + number).innerHTML;

          <div id="title-1" class="message-title" onclick="display(this)">All you need to know about investing.</div>
          <div id="message-1" class="message-text-hidden">Start early</div>

          <input type="text" id="message-text"></input>