# Java: How to interact with ruby generated fields

**URL:** <https://www.ruby-forum.com/t/java-how-to-interact-with-ruby-generated-fields/57025>\
**Category:** Rails\
**Created:** [April 6, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/java-how-to-interact-with-ruby-generated-fields/57025 "2006-04-06T17:14:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![teddio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@teddio](https://www.ruby-forum.com/u/teddio)\
**Post date:** [April 6, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/java-how-to-interact-with-ruby-generated-fields/57025/1 "2006-04-06T17:14:28Z")

</div>

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

\<%= end\_form\_tag %\>

The Javascriptfunction couldn’t get the values of textfieldtwo and  
textfieldthree.

Thanks for your help  
Michael Herzog

---

<div class="post-metadata">

**Author:** ![teddio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@teddio](https://www.ruby-forum.com/u/teddio)\
**Post date:** [April 6, 2006, 5:18pm UTC](https://www.ruby-forum.com/t/java-how-to-interact-with-ruby-generated-fields/57025/2 "2006-04-06T17:18:35Z")

</div>

OT: Please don’t call JavaScript “Java” 🙂

---

<div class="post-metadata">

**Author:** ![teddio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b3f665/32.png) [@teddio](https://www.ruby-forum.com/u/teddio)\
**Post date:** [April 6, 2006, 5:24pm UTC](https://www.ruby-forum.com/t/java-how-to-interact-with-ruby-generated-fields/57025/3 "2006-04-06T17:24:26Z")

</div>

Charles O Nutter wrote:

> OT: Please don’t call JavaScript “Java” 🙂

Sorry, my mistake! ☹
