# To call a modal window before executing link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/to-call-a-modal-window-before-executing-link-to-remote/136282>\
**Category:** Rails\
**Created:** [April 30, 2008, 12:05pm UTC](https://www.ruby-forum.com/t/to-call-a-modal-window-before-executing-link-to-remote/136282 "2008-04-30T12:05:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [April 30, 2008, 12:05pm UTC](https://www.ruby-forum.com/t/to-call-a-modal-window-before-executing-link-to-remote/136282/1 "2008-04-30T12:05:49Z")

</div>

Hi  
I have

\<% @flow\_items = ServiceDeskStatusFlow.find\_all\_by\_service\_desk\_status\_id(@sd\_ticket.service\_desk\_status\_id) %\>
\<% for flow\_item in @flow\_items %\> \<% end %\>

| \<%= link\_to\_remote "#{flow\_item.action\_name}", { :before =\> "javascript:give\_reason\_for\_transfer()", :url =\> { :action =\> :edit\_service\_desk\_status, :sd\_id =\> @sd\_ticket.id, :status\_id =\> flow\_item.flow\_item\_id} }, :class =\> "itillink1"%\> |

This is working.What I need is on clicking #{flow\_item.action\_name}, if  
that is  
‘Transfer Ticket’ , then before executing link\_to\_remote action a modal  
window should be open say with a description asking the reason for  
transferring the ticket also this description to be passed with  
link\_to\_remote.And only after giving reason that window closed and  
link\_to\_remote action executed .Could you please tell me how can i do  
this?Modal window I have implemented in another part of the project  
([http://livepipe.net/projects/control\_modal/](http://livepipe.net/projects/control_modal/))…But how to join that with  
this purpose?

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [April 30, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/to-call-a-modal-window-before-executing-link-to-remote/136282/2 "2008-04-30T16:47:16Z")

</div>

Open a popup and then have the popup get the info then execute a  
javascript call to the opener window with the info and close the  
popup. Either that or have an extra div appear magically within the  
form.  
-R

On Wed, Apr 30, 2008 at 4:05 AM, Sijo Kg

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 1, 2008, 6:07am UTC](https://www.ruby-forum.com/t/to-call-a-modal-window-before-executing-link-to-remote/136282/3 "2008-05-01T06:07:02Z")

</div>

Hi  
thanks for your reply  
Sijo
