Hi,
I have my code wherein I have used 2 TextBoxes , 2 Listboxes and a button.
textbox1 - First Name
textboox2- Last Name
listbox1 - Populated from Emp table in MS Access
listbox2 - Populated from Emp table in MS Access
Button1 - to fetch details of name entered and display on same page on some labels.
TextBox1 has a dropdownextender which is populated from ListBox1 and TextBox2 has a dropdownextender which is populated from ListBox2.
I did the javascript code and the selected value is now showing onto the respective textboxes as below:
ListBox1.Attributes.Add("onclick", "setText1(this.options[this.selectedIndex].value);");
ListBox2.Attributes.Add("onclick", "setText2(this.options[this.selectedIndex].value);");
function setText1(newValue)
{
document.getElementById("<%=txtbx_Firstname.ClientID %>").value = newValue;
}
function setText2(newValue1)
{
document.getElementById("<%=txtbx_Lastname.ClientID %>").value = newValue1;
}
Problem:
When I click the Button to fetch details of entered name, the textboxes gets cleared. due to this, I am not able to make a comparison between the textbox values and database values.
Please help how to retain the textbox values and use in my code.
My full page functionality depends on this.