I added some javascript to the create.html.erb template that opens in
the popup after the document form submits.
The javascript is supposed to close the popup and send the title of
the document back to the main page but it's not working.  Anyone know
why?


this is what is in the create.html.erb template:

<script type="text/javascript">

function copyData(){
    var docField = window.opener.document.getElementById('title');
    docField.setValue('<%=h @doc.title %>');
    this.close();
}

copyData();

</script>



On Mar 23, 6:06 pm, ES <emsto...@gmail.com> wrote:
> I made a popup within object1's form to show another form to create a
> new document object to associate with object1.  When I click the
> submit button I want
> 1) the document object to be created
> 2) the popup to close
> 3) the value in the document "title" field to get added to the
> document name field in object1's form.
>
> I've made the form for the document object in the popup but I'm having
> trouble figuring out the logic for 2) and 3).  I'd imagine I have to
> use javascript to close the popup and send the title back to the main
> page.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to