Onsubmit new window and action


I’m new in javascript, I’m making a function that will open new window upon submitting the form.

How can I combine this two?

function advance(){
    onSubmit="window.open('', 'foo', 'width=450,height=300,status=yes,resizable=yes,scrollbars=yes'

And is it possible to put button close and submit in the new window?
Any help is greatly appreciated.

Yes it is, by gaining a reference to the new window, and from there to the body of that window.
You can then add whatever elements you like to the body of that new window, and attach events so that they can perform desired behaviours too.