Setting Ajax.Updater update target to alternate window?

I need to make a call to Ajax.Updater(container, url, options) where
container needs to be a DOM element in another window.

So assuming my form is in window “X”, can I specify a DOM element in
window “Y” as the update target for my AJAX call?

If I can, what is the correct syntax?


Alternatively, I’m interested in how to dynamically add a form to a
document using the DOM in Javascript.

I’m trying

newForm = document.createElement('form');

but doesn’t seem to be showing up in the document forms array.


I ended up with the Javascript function below.


  • Opens a popup
  • Adds a DIV with wait message and graphic
  • Submits the form request
  • Eval’s the response from the form request which is something along the
    lines of:

page.assign(‘popup.location.href’, ‘…data…’)

which takes the output of the form submission and renders to the



function submit_form_to_popup(form, popup_window_name, action) {
form.action = action;
popup =’’, popup_window_name, ‘width=800, height=700,
left = 450, top = 100, resizable, scrollbars=yes’);
wait_image_url = window.location.protocol + ‘//’ + + ‘/images/indicator_verybig.gif’;

//Create a DIV in the popup window and populate it with the AJAX wait
message and graphic.
newDiv = popup.document.createElement(‘div’);
newDiv.setAttribute(‘id’, ‘pdf’);
newDiv.setAttribute(‘style’, ‘margin-top: 250px; text-align:
newDiv.innerHTML = ‘Please wait while your forms are


//Submit the form asynchronously and execute Javascript returned from
the action.
new Ajax.Request(form.action, { asynchronous: true, method:
‘post’, parameters: Form.serialize(form), evalScripts:
onSuccess: function(request)
return false;

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs