Forum: Ruby on Rails [rails 2.3.2] ajax form issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Kad K. (Guest)
on 2009-03-24 15:08
In a Facebox window (running well with an html form)  ,   I have now an
Ajax form written

<form class="tabular"  onsubmit="new
Ajax.Request('/intranet-dev/welcome/infos_send',
{asynchronous:true, evalScripts:true, parameters:Form.serialize(this)});
return false;"
method="post" action="/intranet-dev/welcome/infos_send">
..
</form>

but when submitted , the request.xhr?  =>  false

what could be wrong ? what did I miss ?

thanks for any enlightenment


erwin von breizh
Frederick C. (Guest)
on 2009-03-24 15:22
(Received via mailing list)
On Mar 24, 1:08 pm, Kad K. <removed_email_address@domain.invalid>
wrote:
>
One possibility is that if the javascript in your onsubmit raises an
exception then the browser falls back to normal form submission (eg if
you don't have the prototype javascript library loaded)

Fred
Kad K. (Guest)
on 2009-03-24 16:32
Frederick C. wrote:
> On Mar 24, 1:08�pm, Kad K. <removed_email_address@domain.invalid>
> wrote:
>>
> One possibility is that if the javascript in your onsubmit raises an
> exception then the browser falls back to normal form submission (eg if
> you don't have the prototype javascript library loaded)
>
> Fred

Thanks Frederick, good shot...  I forgot to read the Firebug console ..
when submitting the form...

Error : $(form).getElementsByTagName is not a function
Source File :
http://aelmat.local/intranet-dev/javascripts/proto...
Line : 3418

I am also using jquery yo display a facebox in which the form is
displayed... I don't think there is any problem in using both libraries
...
Kad K. (Guest)
on 2009-03-24 16:42
Attachment: facebox_div.txt (0 Bytes)
Kad K. wrote:
> Frederick C. wrote:
>> On Mar 24, 1:08�pm, Kad K. <removed_email_address@domain.invalid>
>> wrote:
>>>
>> One possibility is that if the javascript in your onsubmit raises an
>> exception then the browser falls back to normal form submission (eg if
>> you don't have the prototype javascript library loaded)
>>
>> Fred
>
> Thanks Frederick, good shot...  I forgot to read the Firebug console ..
> when submitting the form...
>
> Error : $(form).getElementsByTagName is not a function
> Source File :
> http://aelmat.local/intranet-dev/javascripts/proto...
> Line : 3418
>
> I am also using jquery yo display a facebox in which the form is
> displayed... I don't think there is any problem in using both libraries
> ...


I looked into the facebox div in the source code, I remember reading
comments about having ajax form IN a table...   could it be the point ?

I attached the facebox div code
Greg D. (Guest)
on 2009-03-24 16:53
(Received via mailing list)
On Tue, Mar 24, 2009 at 9:32 AM, Kad K.
<removed_email_address@domain.invalid> wrote:
> I am also using jquery yo display a facebox in which the form is
> displayed... I don't think there is any problem in using both libraries

http://docs.jquery.com/Using_jQuery_with_Other_Libraries



--
Greg D.
http://destiney.com/
Kad K. (Guest)
on 2009-03-24 17:18
Greg D. wrote:
> On Tue, Mar 24, 2009 at 9:32 AM, Kad K.
> <removed_email_address@domain.invalid> wrote:
>> I am also using jquery yo display a facebox in which the form is
>> displayed... I don't think there is any problem in using both libraries
>
> http://docs.jquery.com/Using_jQuery_with_Other_Libraries
>
>
>
> --
> Greg D.
> http://destiney.com/

Thanks a lot  , just adding  ...    (Fred shot 1 help me too, looking at
the Firebug console to see that there was an error... so  ajax called
did not happen ... )

<script type="text/javascript">
  jQuery.noConflict();
  jQuery(document).ready(function($) {
  })
</script>
This topic is locked and can not be replied to.