Forum: Ruby on Rails Get / Set date_select values before form submit

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matt Miller (Guest)
on 2006-06-13 19:14
(Received via mailing list)
Hi, i'm working with a date_select field, and I've got the following
question.

The date_select outputs something that looks like:

<select name="widget[designedon(1i)]">
<option value="2001">2001</option>
</select>

I'm used to using prototype to access form elements, but I seem to be
missing something here.

I'm trying to do:

var dyear = $F('widget[designedon(1i)]');

Basically, i want to get/set the value of the select boxes based on
input
from other form field elements -- "pre-filling" so to speak.  Usually,
when
all else fails, I just give my form tags an ID, and just use $() to
access
them.  However, I dont see how to do *that* in rails.

Anyway, help with this probably fairly trivial misunderstanding of $F()
and
$() would be greatly appreciated.

Thanks!
Matt Miller
http://emergent.urbanpug.com
This topic is locked and can not be replied to.