Forum: Ruby Form validation issue in form_remote_tag

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.
31caecd97fb56c008e240a8707409c14?d=identicon&s=25 Ruby Quest (rubyquest)
on 2007-01-25 15:26
In one of my application, I am using form validation check for
particular form field before submitting the form. The javascript
validation method "validateTitle()" does it work properly. But what my
problem is, the page gets reloaded after submitting the form and there
is nothing on the page EXCEPT response message in the "Respbox" div.

I want to retain my form as it is, after submitting the form(Of course,
with response message).

What is the problem in my code??? Any help is appreciated....

---------My form is simillar to this-----------

<%= form_remote_tag :url => { :action => 'create' },:before => 'return
validateTitle()' ,:update => 'Respbox'  %>

---------my form fields go here------------

<%= submit_tag "Add" %>

<%= end_form_tag %>

-----------My javascript function--------------
function validateTitle()

var title = document.getElementById("item_title").value
  if(title.length == 0 )
    alert("Item Title cannot be empty");
  return false;

This topic is locked and can not be replied to.