Forum: Ruby on Rails Can any one give me answer about remote_form_for..?????

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Vikas G. (Guest)
on 2009-01-16 07:25
Can any one give me answer????

I want to check  whether textfield is empty or not at onsubmit event of
form, but it is not working.
Can any one tell me how to check empty textfield on remote_form_for's
onsubmit event???????????????????????

my code is --------------->

<%remote_form_for(:comments, @comment, :url => @commentUrl, :html =>
{:method => :post, :onsubmit => 'if ($("comments_comment").value == "")
{showNotificationMessage("Please enter comment", Notification.Error,
comments_comment); return false;}'}) do |f| %>
      <%= f.text_area "comment", :rows => 2,

      <%=submit_to_remote f, "Add comment",
        :url => @commentUrl,
        :update => { :success => divID, :failure => divID }%>

 'onsubmit' is not excuted during form submit.
Any one can help me.
This topic is locked and can not be replied to.