coldfusion onclick add code to text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ismailc
    New Member
    • Sep 2006
    • 200

    #1

    coldfusion onclick add code to text box

    Hi, I need help!

    I have a coldfusion report with a form split into two.

    one being an output data table where you can search on output data
    and the other just a normal text box.
    what i'm struggling with is onclick of selected td code/data in bottom table to add the selected code to the top text box.

    Please any ideas!

    Regards,
    Ismail
  • rameshsambu
    New Member
    • Oct 2006
    • 15

    #2
    hi Ismail


    i dont think this thing can be done using coldfusion. but can be done using javascript.

    first you have to give unique names/ids to the controls that you want to link up.
    for eg the bottom control is "bottom" and the top control is "top"

    then you must have a javascript function inside the page eg. "copy_to_to p"

    inside that put code like this

    Code:
    <SCRIPT type=text/javascript>
    
        function  copy_to_top(bottom_value)
        {
    
    document.top.value = bottom_value;
    	    }
    
    </SCRIPT>

    put code like this inside the tag of "bottom"
    Code:
    <input name="bottom" onclick="copy_to_top(this.form.bottom.value);">
    Then it should probably work.
    Last edited by acoder; Apr 2 '12, 01:36 PM.

    Comment

    • sbbabaran
      New Member
      • Nov 2006
      • 2

      #3
      Can you please elaborate and clarify more your problem? I think I can give you an idea on how to solve that.

      Comment

      Working...