javascript - How can i add permanent word to the text box? -
i trying add permanent word textbox.in text box take users firstname automatically when user enters name in firstname textbox using onkeyup="copytext()" function.what want want s add permanent word sitename textbox after getting automatically typed firstname.
here code
<td><input type="text" id="fname" name="fname" value="" placeholder="your first name" onkeyup="copytext()" required /></td> <td><input type="text" id="sitename" name="sitename" value="" placeholder="your site name" readonly/></td>
here javascript code working
<script type="text/javascript"> function copytext() { src = document.getelementbyid("fname"); dest = document.getelementbyid("sitename"); dest.value = src.value; } </script>
this pretty doable jquery:
$('#fname').keyup(function(event) { event.stoppropagation(); $('#sitename').val($('#fname').val()); });
you have remove copytext() function work.
hope helps.
Comments
Post a Comment