Vikas Gholap
2009-Jan-16 05:25 UTC
Can any one give me answer about remote_form_for..?????
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, :style=>"width:100%;padding-right:8px;margin-top:8px;margin-bottom:8px;" %> <%=submit_to_remote f, "Add comment", :url => @commentUrl, :update => { :success => divID, :failure => divID }%> <%end%> ''onsubmit'' is not excuted during form submit. Any one can help me. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---