# Syntax for checking a textbox is in inactive state

**URL:** <https://www.ruby-forum.com/t/syntax-for-checking-a-textbox-is-in-inactive-state/174162>\
**Category:** Ruby\
**Created:** [August 21, 2009, 2:46pm UTC](https://www.ruby-forum.com/t/syntax-for-checking-a-textbox-is-in-inactive-state/174162 "2009-08-21T14:46:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@ravikanth](https://www.ruby-forum.com/u/ravikanth)\
**Post date:** [August 21, 2009, 2:46pm UTC](https://www.ruby-forum.com/t/syntax-for-checking-a-textbox-is-in-inactive-state/174162/1 "2009-08-21T14:46:15Z")

</div>

I am testing a webpage in which i shd chk for a textbox is incative or  
not can any one tell me the syantax for it in ruby

thnx in advance

---

<div class="post-metadata">

**Author:** ![ravikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@ravikanth](https://www.ruby-forum.com/u/ravikanth)\
**Post date:** [August 21, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/syntax-for-checking-a-textbox-is-in-inactive-state/174162/2 "2009-08-21T16:02:15Z")

</div>

What does active/inactive mean? Do you mean blank?

---

<div class="post-metadata">

**Author:** ![ravikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ce7236/32.png) [@ravikanth](https://www.ruby-forum.com/u/ravikanth)\
**Post date:** [August 21, 2009, 4:52pm UTC](https://www.ruby-forum.com/t/syntax-for-checking-a-textbox-is-in-inactive-state/174162/3 "2009-08-21T16:52:53Z")

</div>

Wow, a question with so much missing information. I am guessing:

(1) “Webpage” means “a HTML page containing a FORM element”?

(2) “chk” means “when the FORM arrives at my webserver, I want to take  
action dependent on whether the checkbox is checked or not”?

(3) The server is running some web framework, I guess Rails?

In that case maybe what you want is:

def myaction  
if params[:checkboxname]  
render :text =\> “It was checked!”  
else  
render :text =\> “It was not checked!”  
end  
end

My guesses could be entirely off-base. For example, you might want to be  
testing the checkbox state browser-side in Javascript. The moral is: if  
you want a good answer, please make the effort to post a good question.  
See  
[http://www.catb.org/~esr/faqs/smart-questions.html#intro](http://www.catb.org/~esr/faqs/smart-questions.html#intro)

If you show your existing code (both the HTML template and the  
controller action which handles it) you may get a more accurate answer.  
But if it’s a Rails question, it would be better that you don’t post it  
here, use a Rails mailing list instead.

Regards,

Brian.
