# Question on custom control

**URL:** <https://www.ruby-forum.com/t/question-on-custom-control/182107>\
**Category:** Rails I18n\
**Created:** [January 22, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/question-on-custom-control/182107 "2010-01-22T19:11:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayur\_sk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@mayur\_sk](https://www.ruby-forum.com/u/mayur_sk)\
**Post date:** [January 22, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/question-on-custom-control/182107/1 "2010-01-22T19:11:01Z")

</div>

i have a made a custom control. which has text box and drop down . text  
box has the value and drop down has a units if you change the units the  
value will change accordingly . the problem i am facing is, when i  
change the units the value changes but when i inspect the field in  
firebug the value of the text box is still the old value. hope i am  
clear and thanks for the suggestions.

---

<div class="post-metadata">

**Author:** ![mayur\_sk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@mayur\_sk](https://www.ruby-forum.com/u/mayur_sk)\
**Post date:** [January 22, 2010, 7:16pm UTC](https://www.ruby-forum.com/t/question-on-custom-control/182107/2 "2010-01-22T19:16:20Z")

</div>

Firebug lies sometimes and that might be the issue. Did you try to  
check the value using JS console ?

Regards,  
KK

2010/1/22 Mayur S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![mayur\_sk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@mayur\_sk](https://www.ruby-forum.com/u/mayur_sk)\
**Post date:** [January 22, 2010, 7:23pm UTC](https://www.ruby-forum.com/t/question-on-custom-control/182107/3 "2010-01-22T19:23:29Z")

</div>

ok i tried this when i alert($(‘unit\_text\_box’).value) it shows the new  
value . but right in the next line when i say $(‘unit\_text\_box’).value  
and try to use it in a if condition, it evaluates to the old value  
rather than new value as shown in the alert.
