Topic: Updating view from the controller


OK, so i am currently doing the following:

- in my rhtml file i have a button that when clicked calls the method 'execute' in my controller. The link is as follows:

<% link_to_remote "run", :before => "new Effect.Shake('myform')", :url => {:action => 'execute', :id => @input } %>

- In the 'execute' method I run a loop.

- OK, when a condition in this loop is true I then need to update something in my view, and then return back to my loop.

Going into my problem more specifically, what i am doing is trying to
get input from the user. So, when the user clicks the button on the
webpage, method 'execute' is called in the controller, which
runs a loop. When some condition in this loop is true, i then want to
execute some javascript, which will toggle a textfield into view (or
display a prompt), allow the user to input a string, and when confirmed
(OK clicked), feed ths string back into a variable in my loop.

Is this possible or am i dreaming?