I`m trying to call a javascript function to validates some data on a form, and if they are ok, fill a form field (hidden field).
After this step I want to clean some form fields and proceed with the post action of the form.
So the result on my controller would be this hidden field, filled by my javascript logic, and the other fields cleared.
How can I accomplish this on Rails 4 ?
Thanks in advance