Using checkboxes without a form?

Hi, I would like to use checkboxes in a list without enclosing them in a
form and:

  1. Save interactions to the database
  2. Change the appearance of the
  3. when checked/unchecked

Also, I would like this done without reloading the

  • . Is this
    possible? Thanks!
  • Sure you can do that. You will need a combination of JavaScript,
    DHTML, AJAX.

    You will need AJAX to accomplish #1 requirement to make a remote call
    to the server. You only need DHTML driven by JavaScript to accomplish
    #2.

    You will need AJAX to accomplish #1 requirement to make a remote call
    to the server. You only need DHTML driven by JavaScript to accomplish
    #2.

    Thanks! Is there any way to accomplish this using Rails-helpers?

    On 4 Oct 2007, at 11:04, Gus Vs wrote:

    You will need AJAX to accomplish #1 requirement to make a remote call
    to the server. You only need DHTML driven by JavaScript to accomplish
    #2.
    Thanks! Is there any way to accomplish this using Rails-helpers?

    off the top of my head you want something like

    check_box_tag(‘enabled’, ‘1’, is_enabled?, :onchange =>
    remote_function( :url => {:action => ‘checkbox changed’}))

    If you don’t need server interaction, replace remote_function with
    the javascript of your choice. You can use update_page if you want to
    generate the javascript via an rjs like syntax rather than writing it
    by hand.

    Fred

    OK, I think this is related to something I’m trying to do…

    I have bunch of JSON data that gets loaded onLoad and displayed. I’d
    like to have a set of checkboxes that I can use to dynamically exclude/
    include certain subsets of the data with. I’m sure this should be
    pretty simple… but I’m new. Could someone point me to any examples,
    etc.?

    thanx,
    skwasha

    On Oct 4, 4:48 am, Frederick C. [email protected]

    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