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

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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

The date_select outputs something that looks like:

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

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
from other form field elements -- "pre-filling" so to speak.  Usually,
all else fails, I just give my form tags an ID, and just use $() to
them.  However, I dont see how to do *that* in rails.

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

Matt Miller
This topic is locked and can not be replied to.