combobox Value disappears ?

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 136
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 7
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

combobox Value disappears ?

 
0
  #1
Jul 14th, 2009
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.

  1. // ddTTDBenefitP1
  2. ddTTDBenefitP1.SelectedIndex = 0;
  3. string ddTTDBenefitP1_script = string.Format("javascript:document.getElementById('{0}').innerText = {1}.options[{1}.selectedIndex].value;", lblBenefitPeriodFactor1.ClientID, ddTTDBenefitP1.ClientID);
  4.  
  5. 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 ?
Last edited by cVz; Jul 14th, 2009 at 5:11 am.
Delphi & C# programmer deluxe...
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 54
Reputation: ryuslash is an unknown quantity at this point 
Solved Threads: 10
ryuslash's Avatar
ryuslash ryuslash is offline Offline
Junior Poster in Training

Re: combobox Value disappears ?

 
0
  #2
Jul 14th, 2009
The way I tested it it works fine if you don't use a label but a HiddenField
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 164
Reputation: dnanetwork has a little shameless behaviour in the past 
Solved Threads: 24
dnanetwork's Avatar
dnanetwork dnanetwork is offline Offline
Junior Poster

Re: combobox Value disappears ?

 
0
  #3
Jul 14th, 2009
could be more specific with code....may be i can help you out..?
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 136
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 7
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

Re: combobox Value disappears ?

 
0
  #4
Jul 14th, 2009
Ah thanks guys its definately the label , it doenst have postback value ... i forgot

Thanks so much ....
Delphi & C# programmer deluxe...
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 164
Reputation: dnanetwork has a little shameless behaviour in the past 
Solved Threads: 24
dnanetwork's Avatar
dnanetwork dnanetwork is offline Offline
Junior Poster

Re: combobox Value disappears ?

 
0
  #5
Jul 14th, 2009
Originally Posted by cVz View Post
Ah thanks guys its definately the label , it doenst have postback value ... i forgot

Thanks so much ....
gud 4 u....Enjoy programming...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC