Hi

I have a form with
1. dropdown (ddTTDBenefitP1)
2. label (lblBenefitPeriodFactor1)

The combobox is populated with listitems
[Text & value]

I applied attributes to this dropdown.

// ddTTDBenefitP1
ddTTDBenefitP1.SelectedIndex = 0;
string ddTTDBenefitP1_script = string.Format("javascript:document.getElementById('{0}').innerText = {1}.options[{1}.selectedIndex].value;", lblBenefitPeriodFactor1.ClientID, ddTTDBenefitP1.ClientID);

ddTTDBenefitP1.Attributes.Add("onChange", ddTTDBenefitP1_script);

So when a user changes the selectedItem , the label display's the value of the selected Item.

However, when i save, i need to grab the value of the label.

But for some reason its 0 or blank ... But the actual text is not

Can anyone help ?

Recommended Answers

All 4 Replies

The way I tested it it works fine if you don't use a label but a HiddenField

could be more specific with code....may be i can help you out..?

Ah thanks guys its definately the label , it doenst have postback value ... i forgot :)

Thanks so much ....

Ah thanks guys its definately the label , it doenst have postback value ... i forgot :)

Thanks so much ....

gud 4 u....Enjoy programming...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.