Hi all I have written a javascript function where I pass 3 arguments from code behind I am having a text box, button and a text box on my form on leaving text box or clicking the button when the cursor is inside the first text box I would like to fill the second text box from the script I call the script inside the button as follows
<script type="text/javascript">
function getEndDate2(noOfWeeks, sEmployeeWeeklyOfDay, DateStart) {
// My script code
}
<asp:TextBox ID="txtString" runat="server"></asp:TextBox>
<br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="btnClick" runat="server" Text="Pass" OnClick="btnClick_Click" />
protected void btnClick_Click(object sender, EventArgs e)
{
int noOfweeks = Convert.ToInt16(txtString.Text);;
string sEmployeeWeeklyOfDay = "Friday";
string DateStart = DateTime.Now.AddDays(3).ToString();
btnClick.Attributes.Add("onClick", "getEndDate2('" + noOfweeks + "','" + sEmployeeWeeklyOfDay + "','" + DateStart + "');");
// Some code to insert the values to database
}
But unable to display the value in the second text box can some one help me how can I call that script Immediately after losing focus on from the text box or any method to fill the text box first