I’m trying to have a select form where users select a state, and once
they do that, another select list appears with all the colleges in that
state.
I got it to work using a form_remote_tag, but that required the user to
select their state, then hit a submit button. Is there a good way to do
this using something like :onchange?
Here is the beginning of my first select:
The problem is, I’m checking in “get_schools” and the state is not
getting passed in. How do I pass it in?
I’m trying to have a select form where users select a state, and once
they do that, another select list appears with all the colleges in that
state.
I got it to work using a form_remote_tag, but that required the user to
select their state, then hit a submit button. Is there a good way to do
this using something like :onchange?
Here is the beginning of my first select:
The problem is, I’m checking in “get_schools” and the state is not
getting passed in. How do I pass it in?
Still having some problems with this. Can’t seem to pass the value of
the select form into the “get_schools” function.
I’d recommend you pick up Cody F.'s RJS tutorial at O’Reilly. I’ll
put
you on the right track. The way you’re mixing Rails/Ruby with HTML/JS,
Rails can’t tell what to do with the pieces you’re giving it.