How to clear an input box from the controller?

hi!

I have a normal text input box on a page. The controller renders results
to another div, but I need to clear the content of the input box after a
search. Most of my interaction is done with something like

page.replace_html(‘div’,newcontent)

but in this case the element I am addressing is a inputbox and doesn’t
have inner html, only a value? how can I adress this value?

As always, your patience is greatly appreciated.

Regards

Pieter

page[‘search_field’].value = ‘’

Replace ‘search_field’ with the actual ID of your search field

Sharagoz – wrote:

page[‘search_field’].value = ‘’

Replace ‘search_field’ with the actual ID of your search field

Hi Sharagoz

Thanks a million. Obvious… My brain is getting to old for this stuff.

Would it be possible to set other specific attributes of DOM elements in
the same way?

eg would

page[‘id_of_element’].enabled = false

work?

thanks again

Would it be possible to set other specific attributes of DOM elements in
the same way?
Why dont you experiment with it yourself to learn this, now that you
know the syntax

would page[‘id_of_element’].enabled = false work?
I dont think so, but “disabled = true” will work :slight_smile:

Sharagoz – wrote:

Would it be possible to set other specific attributes of DOM elements in
the same way?
Why dont you experiment with it yourself to learn this, now that you
know the syntax

would page[‘id_of_element’].enabled = false work?
I dont think so, but “disabled = true” will work :slight_smile:

I am humbled. Thanks again!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs