Add new line of data to TextBox in Javascript
Add a new line after text has been added to a textbox
<script language="javascript" type="text/javascript">
function getSelected(source, eventArgs) {
var s = $get("<%=NameTextBox.ClientID %>").value;
document.getElementById('<%= NPTextBox.ClientID %>').value = s.substring(s.length - 10);
}
</script>
Use the newline character ('\n'), like this:
<script language="javascript" type="text/javascript">
function getSelected(source, eventArgs) {
var s = $get("<%=NameTextBox.ClientID %>").value;
document.getElementById('<%= NPTextBox.ClientID %>').value += s.substring(s.length - 10) + '\n';
}
</script>