hey i want to change the textbox from the dropdownlist.....whatever item is selected from my dropdownlist i want to display in my textbox......i have used the below code but its not working.
and i also want to autogenerate the code for employee code for eg. if employee first name Aaron and last name is Lobo then, his employee code will be AL i.e first letter of first name and last name.
Please help and correct me if the code is wrong somewhere.........
<%@ Page Language="C#"
AutoEventWireup="true" CodeFile="employeedetail.aspx.cs"
Inherits="employeedetail" %> Untitled Page
First Name:Mantu;
Last Name:
Sahu
Employee Code:
Employee Type:
Rate:;
Work Hours:
Total:;
<script language="javascript">
function ShowValue()
{
document.form1["txtrate"].value = document.form1["ddltype"].value;
}
</script>
public partial class employeedetail : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e) { if
(!Page.IsPostBack) { ArrayList items = new
ArrayList(); items.Add("Regular");
items.Add("Non-Regular"); ddltype.DataSource = items;
ddltype.DataBind(); } }
protected void ddltype_SelectedIndexChanged(object sender,
EventArgs e) { ddltype.Attributes.Add("onchange",
"javascript:ShowValue()"); }