Michael Herzog
2006-Apr-06 15:14 UTC
[Rails] Java: How to interact with ruby generated fields
Hello community, I''m new to rubyonrails and to this Forum. I have to call 2 Fields, generated by ruby, from a javafunction (onSubmit) but when I use this example it didn''t work, why? <%= start_form_tag({:action=> "show"}, { :onSubmit =>"post[testfieldone].value=examplefunction(post[textfieldtwo].value+post[textfieldthree].value);" }) %> ----snip <%= hiddenfield_field "post", "textfieldone", :size => 20%> <%= text_field "post", "textfieldtwo", :size => 20%> <%= text_field "post", "textfieldthree", :size => 20%> ----snip <input type="submit" value="Sign In »" class="primary" /> <%= end_form_tag %> The Javascriptfunction couldn''t get the values of textfieldtwo and textfieldthree. Thanks for your help Michael Herzog -- Posted via http://www.ruby-forum.com/.
Charles O Nutter
2006-Apr-06 15:18 UTC
[Rails] Java: How to interact with ruby generated fields
OT: Please don''t call JavaScript "Java" :) On 4/6/06, Michael Herzog <teddio@gmx.de> wrote:> > Hello community, > > I''m new to rubyonrails and to this Forum. I have to call 2 Fields, > generated by ruby, from a javafunction (onSubmit) but when I use this > example it didn''t work, why? > > <%= start_form_tag({:action=> "show"}, { :onSubmit > > =>"post[testfieldone].value=examplefunction(post[textfieldtwo].value+post[textfieldthree].value);" > }) %> > > ----snip > > <%= hiddenfield_field "post", "textfieldone", :size => 20%> > <%= text_field "post", "textfieldtwo", :size => 20%> > <%= text_field "post", "textfieldthree", :size => 20%> > > ----snip > > <input type="submit" value="Sign In »" class="primary" /> > <%= end_form_tag %> > > The Javascriptfunction couldn''t get the values of textfieldtwo and > textfieldthree. > > Thanks for your help > Michael Herzog > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Charles Oliver Nutter @ headius.blogspot.com JRuby Developer @ jruby.sourceforge.net Application Architect @ www.ventera.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060406/11862809/attachment.html