You must Sign In to post a response.

Add Text in Drop Down List

When we have drop down list to select "add text", it should change to text box to enter. Is it possible? ASP Net 2.0 using C#?

Please let me know.

Thank you.


Comments

Author: Jai01 Nov 2008 Member Level: Gold   Points : 3

u should have a textbox and a drop down..
at the page load the visibility of the textbox should be hidden

on the onchange event of drop down u should call this javascript function

Eg;





function Show_TextBox()
{
if(document.getElementById('ddlOutCome').value=="Add Text")
{
document.getElementById('txtOutCome').style.display='block';
}
else if(document.getElementById('ddlOutCome').value!="Add Text")
{
document.getElementById('txtOutCome').style.display='none';
}
}

Author: Raji01 Nov 2008 Member Level: Gold   Points : 1

hi

try to set visibility of the textbox on dropdownlist selected index changed event






Choose TExt:
-- Add Text--





Page_Load()
{
if(!IsPostback())
{
txtCategory.visible=false;
btnSave.visible=false;
btnCancel.visible=false;
}

}

on ddlPackage_SelectedIndexChanged()
{
if(ddlPackage.SelectedValue.Trim()=="0")
{
ddlPackage.visible=false;
txtCategory.visible=true;
btnSave.visible=true;
btnCancel.visible=true;
}
}

I think this'll help u

Regards
Raji

Author: Varun Bansal01 Nov 2008 Member Level: Gold   Points : 2

try this
on page_load()
{
textbox1.visible=false;
btnsave.visible=false;
btncancel.visible=false;

}

ddl_SlectedindexChanged()

{

if(ddl.selecteditem.text="add text")
{
textbox1.visible=true;
btnsave.visible=true;
btncancel.visible=true;
}


Sign In to post your comments