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
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
What does active/inactive mean? Do you mean blank?
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
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs