javascript - two ways binding from multiple text boxes to single text area in jquery -
i bit of situation needed update data text box (multiple) text area.
i have 5 textboxes in entering names , 1 text area updating automatically according name change in text boxes.
textbox 1 = "i",textbox 2 = "am",textbox3 = "trying ",textbox4 = "to ",textbox5 = "concatenate"
then, text area should show. - trying concatenate.
now if update in text area changed "trying" "tried" , after changed in textbox1 "i" "we" in text area should not replace "tried" word again.
i trying using jquery. there solution this, please let me know.
thanks
you can try this:
<!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(".inputtext").keyup(function(){ $('#result')[0].innerhtml=$('#one').val()+$('#one1').val()+$('#one2').val()+$('#one3').val()+$('#one4').val(); //$("input").css("background-color", "pink"); }); }); </script> </head> <body> <input type="text" class="inputtext" id="one"/> <input type="text" class="inputtext" id="one1"/> <input type="text" class="inputtext" id="one2"/> <input type="text" class="inputtext" id="one3"/> <input type="text" class="inputtext" id="one4"/> <br /><br /> result: <textarea id="result"></textarea> </body> </html>
Comments
Post a Comment