Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%= f.check_box :foobar, :onchange => "
- if(this.checked==true) {
- $('binding_pp').visualEffect('Appear');
- Element.update('phone_number_select', '#{render :partial => \"foobar1\"}')
- } else {
- $('binding_pp').visualEffect('Fade');
- Element.update('phone_number_select', '#{render :partial => \"foobar2\"}')
- }
- " %>
- # foobar1 and foobar2 both render something like
- f.select :phone_number, ....
- # but with different options. I cannot use display:none CSS
- # because then there would be two "phone_number" objects
- # in the submitted form data, even if one is invisible, and
- # this would cause wrong data to be submitted (potentially).
Add Comment
Please, Sign In to add comment