# Ajax submit

**URL:** <https://www.ruby-forum.com/t/ajax-submit/176431>\
**Category:** Ruby\
**Created:** [September 30, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/ajax-submit/176431 "2009-09-30T14:22:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharankruthi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sharankruthi](https://www.ruby-forum.com/u/sharankruthi)\
**Post date:** [September 30, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/ajax-submit/176431/1 "2009-09-30T14:22:01Z")

</div>

Hi,

Am able to ajax submit a form in rails view using submit\_to\_remote and  
as expected my results are updated in div without refreshing whole page.  
But if i use prototype library am not able to use jquery in that page,  
so is it possible to submit a form without using prototype library?

---

<div class="post-metadata">

**Author:** ![sharankruthi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sharankruthi](https://www.ruby-forum.com/u/sharankruthi)\
**Post date:** [September 30, 2009, 3:50pm UTC](https://www.ruby-forum.com/t/ajax-submit/176431/2 "2009-09-30T15:50:55Z")

</div>

Sharanya S. wrote:

> Hi,
> 
> Am able to ajax submit a form in rails view using submit\_to\_remote and  
> as expected my results are updated in div without refreshing whole page.  
> But if i use prototype library am not able to use jquery in that page,  
> so is it possible to submit a form without using prototype library?

The best thing for you to do is to install the jrails plugin (or gem  
maybe?) which replaces all of the built-in prototype helpers with jquery  
equivalents. After doing that, when you say link\_to\_remote, all of the  
additional javascript that rails puts in for you will use jquery instead  
of prototype, and you can banish prototype completely. You don’t need  
to make any changes to your code.

This post belongs in the Ruby on Rails section rather than the Ruby  
section btw 🙂

---

<div class="post-metadata">

**Author:** ![sharankruthi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sharankruthi](https://www.ruby-forum.com/u/sharankruthi)\
**Post date:** [September 30, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/ajax-submit/176431/3 "2009-09-30T15:54:07Z")

</div>

oh and as a side note, you can mix and match jquery and prototype, as  
long as  
a) you use the noconflict option with your jquery code (so $(whatever)  
will always use prototype), and  
b) you write out jQuery(whatever) instead of $(whatever) whenever you  
want to use jquery.

However, it’s simpler to just banish prototype and switch to 100% jquery  
as described above.

---

<div class="post-metadata">

**Author:** ![sharankruthi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sharankruthi](https://www.ruby-forum.com/u/sharankruthi)\
**Post date:** [October 1, 2009, 6:04am UTC](https://www.ruby-forum.com/t/ajax-submit/176431/4 "2009-10-01T06:04:53Z")

</div>

Max W. wrote:

> oh and as a side note, you can mix and match jquery and prototype, as  
> long as  
> a) you use the noconflict option with your jquery code (so $(whatever)  
> will always use prototype), and  
> b) you write out jQuery(whatever) instead of $(whatever) whenever you  
> want to use jquery.
> 
> However, it’s simpler to just banish prototype and switch to 100% jquery  
> as described above.

Thankx a ton 🙂
