user3503395
user3503395

Reputation: 61

How To Value Copy and Paste in another Textbox from Dropdown

Hi guys can anyone tell me how to copy a field value to another field when we just like use check box in dropdown we have to click a check box then value Copy in textbox. When we have Select Checkbox Value Move in textbox auto.

I am using MultiSelect Dropdwon list and my need it when i am Select Checkbox Value like option 1 or 2 value Move in textbox automatic in below text box.

screenshot

      <SCRIPT language="JavaScript">
       $(document).ready(function() {
    $("#dropdown").on('change',function(){
    var dropdownVal=this.value;

    $("#textbox").val(dropdownVal); 
    });

     });

    </SCRIPT>
    </head>
     <body onload="prettyPrint();">

    <form>
   <p>
    <select multiple="multiple" name="dropdown" style="width:370px">
    <option value="red">Red</option>
    <option value="green">Green</option>
    <option value="blue">Blue</option>
    <option value="orange">Orange</option>

    </select>
   </p>

    <input type="text" class="normal" id="textbox" name="textbox"    
            style="width:450px;"></td>

             </form>

           <script type="text/javascript">
               $("select").multiselect().multiselectfilter();
             </script>

Upvotes: 0

Views: 1470

Answers (1)

Gaurav Parashar
Gaurav Parashar

Reputation: 126

i think it may help you ..... one two three four

$(document).ready(function() {
    $("#dropdown").on('change',function(){
        var dropdownVal=this.value;

        $("#textbox").val(dropdownVal); 
    });

});

</script>

Upvotes: 1

Related Questions