title: How to use client_side_validation plugin with facebox
body: <p>Today I installed client_side_validation plugin, everything works well until I encountered an issue, form validation cannot be accomplished in a modal window(facebox). Every time I clicked on submit button, it will close the modal window and update stuff regardless of what have been typed. Here is my code.</p>
  
  <p>My form</p>
  
  <pre><code>&lt;%= form_for (@task, :remote=&gt;true, :validations =&gt; true) do |f| %&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label "Remind me every"%&gt;
     &lt;%= f.text_field :frequency %&gt;
     &lt;%= f.label "days before" %&gt;
        &lt;/div&gt;
    &lt;div class="field"&gt;
  &lt;br/&gt;
  &lt;%= f.date_select :deadline, :start_year=&gt;Time.now.year,:include_blank =&gt; true%&gt;
  &lt;%= f.submit "Submit" %&gt;
   &lt;/div&gt;  
  &lt;% end %&gt;
  </code></pre>
  
  <p>My update function in controller</p>
  
  <pre><code>def update
     @task=Task.find(params[:id]);
     @task.update_attributes(params[:task])
     @task.reminded=true
     respond_to do |format| 
     if @task.save
      format.html
      format.js{
      render :update do |page|
        page &lt;&lt; "jQuery.facebox.close();"
        yield(page) if block_given?
      end
      }
     else
     format.html
     format.js
     end
   end
  end
  </code></pre>
  
  <p>Can anyone help me out here? Thanks!</p>