checkbox list to generate one textbox-Collection of common programming errors
So i have this checkbox list and im trying to generate a textbox when the MISC checkbox is checked.
Laptop
Label Printer
Printer
Fax Line
PC
MFD
Phone Line
Misc
ON my Cs page I have………
protected void chbxEquipmnt_SelectedIndexChanged(object sender, EventArgs e)
{
if (chbxEquipmnt.SelectedValue == "Misc")
{
TextBox txt = new TextBox();
txt.ID = "txtMiscCheckBox";
Page.Form.Controls.Add(txt);
}
}
debugging i have tried with Postback which continuously on returns the first check box that was checked…for example i checked laptop instead of Misc first, the value in the debugger always show me laptop. Im not sure if a simple loop to go thru the all the button clicks would help…..I’m fresh out of school and this is a career change for me so thanks for the patience