problem --> "onsubmit" in "remote_form_for" ?????????

V

Vikas Gholap

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, :eek:nsubmit => '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%>
 
B

Brian Candler

Vikas said:
I want to check whether textfield is empty or not at onsubmit event of
form, but it is not working.

Sorry, but you've stumbled onto the wrong mailing list. This list is for
the Ruby programming language; there are some Rails people here, but you
are more likely to find the answers you need on a mailing list for the
Rails framework (which just happens to be written in Ruby)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top