Posted  11 Sep 2009 - 21:50:08

Category: Ruby on Rails

Perform validation before sending Rails form

You want to add some sort of javascript validation before submiting your form.

You could add the :before attribute to your form. You can put any js in here and I personally used it to add data from an iframe to a hidden field that was passed on to the controller.

form_remote_tag :url => "/login", :update => 'temp', :before => 'if( !validate(this) ) return false' do

Marked as helpful by 1 user


© SolutionCottage 2008-2011 9/24/2017 1:17:08 PM