How To Value Copy and Paste in another Textbox fro

2019-09-18 19:42发布

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>

1条回答
beautiful°
2楼-- · 2019-09-18 20:02

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>
查看更多
登录 后发表回答