# How to use :popup with remote\_function

**URL:** <https://www.ruby-forum.com/t/how-to-use-popup-with-remote-function/173773>\
**Category:** Rails\
**Created:** [August 14, 2009, 3:45pm UTC](https://www.ruby-forum.com/t/how-to-use-popup-with-remote-function/173773 "2009-08-14T15:45:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akramwasim1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Post date:** [August 14, 2009, 3:45pm UTC](https://www.ruby-forum.com/t/how-to-use-popup-with-remote-function/173773/1 "2009-08-14T15:45:48Z")

</div>

Hi All,  
Please tell me how to use a :popup with remote\_function  
I have a select box and I have to show the names associated  
with the item in a seperate popup when that item is selected.

my code is  
VIEW:  
\<%= select\_tag “filled”, options\_for\_select(@filled),  
{ :onchange =\>  
remote\_function(  
:url =\> {:action =\> ‘needstatus’,:id=\>need.id},  
:with =\> “‘status=’+this.value” ) } %\>

CONTROLLER:

def needstatus  
if params[:status]  
render :partial =\> ‘needstatus’  
end  
end

and I dont know where to use the :popup, i’ve tried using the popup in  
all the places but I cant get any new window can anybody help me

---

<div class="post-metadata">

**Author:** ![akramwasim1234](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@akramwasim1234](https://www.ruby-forum.com/u/akramwasim1234)\
**Post date:** [August 15, 2009, 12:33pm UTC](https://www.ruby-forum.com/t/how-to-use-popup-with-remote-function/173773/2 "2009-08-15T12:33:05Z")

</div>

On 14 Aug 2009, at 14:44, Kart wrote:

> Hi All,  
> Please tell me how to use a :popup with remote\_function  
> I have a select box and I have to show the names associated  
> with the item in a seperate popup when that item is selected.

It doesn’t soon like you need to use remote\_function at all - just  
have your onchange do a window.open with the appropriate url

Fred
