SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast Stevenwulf's Avatar
    Join Date
    May 2002
    Location
    Berkeley
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FormOptionsHelper.select

    Hi,

    When using the select() helper, is there any way to specify the DOM id?

    This isn't working:
    select("", "name", "list", {:id => 'dom_id'})

    To be able to use observe_field with this select list, I need to be able to set its id.

    Thanks,
    Steven

  2. #2
    SitePoint Enthusiast Stevenwulf's Avatar
    Join Date
    May 2002
    Location
    Berkeley
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I found the answer.

    The 5th parameter of select() is where this needs to be set.

    so
    Code:
     
       select("", "platform_id" @platforms, {:prompt=>true}, {:id=>'platform_list'})
    output:
    HTML Code:
       <select name="platform_id" id="platform_list">
         <option>Please select</option>
         <option>platform1</option>
       </select>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •