# sortable\_element-onUpdate

**URL:** <https://discuss.rubyonrails.org/t/sortable-element-onupdate/50056>\
**Category:** rubyonrails-talk\
**Created:** [March 11, 2010, 5:19am UTC](https://discuss.rubyonrails.org/t/sortable-element-onupdate/50056 "2010-03-11T05:19:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [March 11, 2010, 5:19am UTC](https://discuss.rubyonrails.org/t/sortable-element-onupdate/50056/1 "2010-03-11T05:19:35Z")

</div>

Hi All,

Please check the below code and let me know whats the problem with the code.

\<%= sortable\_element("parent\_drag",:tag=\>"div",:handle=\>"legend", :dropOnEmpty =\> true, :constraint=\>false,:onUpdate=\>"function(){return reorder\_collection();}") %\>

I'm trying to call a JS function, but its not working.

Thanks & Regards, Priyadharsini T
