rubyonrailsin

A Ruby and Rails talk

Tuesday, March 9, 2010


Re: [Rails] Ajax-submit form on "check box onclick ": why this error?

by rubyonrailsin 0 comments



Share this post:
Design Float
StumbleUpon
Reddit

I think...
Dont use #{....}

<%= check_box_tag 'whatever', nil, whatever, { :onclick =>
"remote_function('this.form.

submit();')", :disabled => false } %>

But I dont because i never try it...
keep trying


On Wed, Mar 10, 2010 at 1:02 AM, Tom Ha <lists@ruby-forum.com> wrote:
Hi there,

I need to have a checkbox which ajax-submits a form.

The following code throws an error "index 112009 out of string". What's
wrong here?

==============================================
<% form_remote_tag :url => { whatever_url } do -%>

<%= check_box_tag 'whatever', nil, whatever, { :onclick =>
"#{remote_function('this.form.submit();')}", :disabled => false } %>

<% end -%>
==============================================

Thanks for any help with this!
Tom
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--

Senior Rails Developer
Anton Effendi - Wu You Duan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive