get the value before dropdown changed
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Zhang
Posted On:   Thursday, April 24, 2003 02:20 PM

I have an onchange event for a dropdown,when dropdown changed value,how can I get the value before it changed

Re: get the value before dropdown changed

Posted By:   Nitesh_Naveen  
Posted On:   Friday, April 25, 2003 03:58 AM

guess you need to know it everytime and not just the first time around. You can use teh onfocus evetn to grab the curent selected value. like ...









Re: get the value before dropdown changed

Posted By:   neal_ravindran  
Posted On:   Friday, April 25, 2003 01:10 AM

Set a hidden variable in the html form with value of "" initially.

In the onchange function overwrite the hidden variable value with the selected value...This is done as the first step in the onchange function. Thus the just-before-change value is stored

Re: get the value before dropdown changed

Posted By:   Jeschael_Lebbink  
Posted On:   Thursday, April 24, 2003 02:53 PM

Create your own ComboBoxModel by extending it. It will remember the old value for you when it changes. Use it with your ComboBox by setting it with setModel(ComboBoxModel aModel) and getModel().

Re: get the value before dropdown changed

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, April 24, 2003 02:53 PM

Gee maybe you should have thought of that before you went and changed the value! :-)



(in other words, save/remember the values first -- when first initialized, changed, etc. so you have them, the next time a change occurs)

About | Sitemap | Contact