Is there a way to get a value from one text field and add it to another using jQuery dynamically when the user enters a value into the text field? can someone explain the method if there is such a thing?
regrds, rangana
Do you mean something like http://jsfiddle.net/ZLr9N/ ?
$('#first').keyup(function(){ $('#second').val(this.value); });
. keyup input. , , - - input, keyup(). input input val(). !
keyup
input
keyup()
val()
$('#textbox1').keypress(function(event) { $('#textbox2').val($('#textbox1').val() + String.fromCharCode(event.keyCode)); });
, textbox2 textbox1.
textbox2
textbox1
.. keyup, , . , "" . , , keyup, keypress , keyup.
keypress
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" > <html lang="en"> <head> <title><!-- Insert your title here --></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#from').keyup(function(event) { $('#to').text($('#from').val()); }); }); </script> </head> <body> <textarea id="from" rows=10 cols=10></textarea> <textarea id="to" rows=10 cols=10></textarea> </body> </html>
$(document).ready(function(){ $("#textbox1").blur(function(){$('#textbox2').val($('#textbox1').val()}); }
The action will be performed when the text field is eroded.
Source: https://habr.com/ru/post/1762120/More articles:How to reset primary key index to 1 using Visual Studio 2008 Server Explorer? - sqlHow to label and license source code? - c #An IDE for PHP with a visual designer? - phpЯ хочу скопировать и запустить файл .exe на удаленной машине Windows? - c#hook_load / hook_view not called - drupalHow to check if header () is set in PHP? - phpПреобразование html в текст с использованием языка python - pythonrails how to know when send_file - ruby-on-railshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1762124/google-app-engine-w-django-inboundmailhandler-appears-to-only-work-once&usg=ALkJrhgJwq7R1QYvp3Lmfcov-zTNIS4bPQReplace an element using phpquery (php version of jquery) - phpAll Articles