but it not works well. if condition return false then my form is not get
submitted this is exactly what i want but when it returns true it
produce something like this o/p on UI.
I guess this is a JavaScript issue. What about showing us that?
Thanx 4 ur reply
No i am just telling what problem i m facing.
i just want to know is onsubmit working properly with remote_form_for?
and wheather there is any syntax error in my code above ?
I want to use onsubmit for a form validation using javascript on
remote_form_for
but it not works well. if condition return false then my form is not get
submitted this is exactly what i want but when it returns true it
produce something like this o/p on UI.
<% remote_form_for :timesheet, @timesheet, :url =>{:action =>
‘report_user’}, :html => {:onsubmit=>“return ValidateDate();” } do |f|
%>
I guess this is a JavaScript issue. What about showing us that?
Thanx 4 ur reply
No i am just telling what problem i m facing.
i just want to know is onsubmit working properly with remote_form_for?
and wheather there is any syntax error in my code above ?
No, remote_form_for will use the onsubmit event to make the actual
AJAX request. So I don’t think overriding the onsubmit attribute would
be a good idea…
No, remote_form_for will use the onsubmit event to make the actual
AJAX request. So I don’t think overriding the onsubmit attribute would
be a good idea…
thanx @David.
Do you know what should do in that case to put javascript form
validations?
The ajax helpers can take a :conditions parameter which is a fragment
of javascript to run to check whether the request should go ahead
(it’s described in the docs for link_to_remote)
No, remote_form_for will use the onsubmit event to make the actual
AJAX request. So I don’t think overriding the onsubmit attribute would
be a good idea…
thanx @David.
Do you know what should do in that case to put javascript form
validations?
Thanx & Regards
Salil
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.