How To Join Two TextBox Values Using Javascript

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AutoName.aspx.cs"
Inherits="AutoName" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<head id="Head1" runat="server">
  <title>Untitled Page</title>
  <form id="form1" runat="server">
          <asp:TextBox ID="firstName" runat="server" onkeyup="autoname( );" Text="First" />
          <asp:TextBox ID="lastName" runat="server" onkeyup="autoname( );" Text="Last" />
          <asp:TextBox ID="fullName" runat="server" Text="" />

  <script type="text/javascript">

  function autoname( )
      var temp = document.getElementById( "firstName" ).value.toLowerCase( );
      temp += " "+ document.getElementById( "lastName" ).value.toLowerCase( );

      document.getElementById( "fullName" ).value = temp;

  autoname( );



Post a Comment

Please do not post any spam link in the comment box😊

Previous Post Next Post

Blog ads