POST data to a new page

W

William E Hatto

Hi all,

Sorry if this sounds a little ambiguous, but....

I have a page with 4 submit buttons. How can I make 1 of these buttons spawn
a new page AND use the data posted from the orginal page?

Can this be down. I know I could do it with a querystring but I perfer not
too.

Cheers, Bill.
 
B

Bob Barrows [MVP]

William said:
Hi all,

Sorry if this sounds a little ambiguous, but....

I have a page with 4 submit buttons. How can I make 1 of these
buttons spawn a new page AND use the data posted from the orginal
page?

Can this be down. I know I could do it with a querystring but I
perfer not too.

Cheers, Bill.

Set the target attribute of the form element to "_blank".

Bob Barrows.
 
W

William E Hatto

Thanks Bob,

I only want one of the submit buttons to lauch a new window though.

Any ideas.

Thanks Bill.
 
B

Bob Barrows [MVP]

The target attribute can be changed dynamically using client-side code.
Please go to a dhtml or scripting group for future help with this.

I would change the INPUT from a Submit to a Button, and use this in the
onclick event:

var oForm =document.getElementByID("form_id")
oForm.target="_blank"
oForm.submit()

HTH,
Bob Barrows
 
W

William E Hatto

Thanks Bob :)


Bob Barrows said:
The target attribute can be changed dynamically using client-side code.
Please go to a dhtml or scripting group for future help with this.

I would change the INPUT from a Submit to a Button, and use this in the
onclick event:

var oForm =document.getElementByID("form_id")
oForm.target="_blank"
oForm.submit()

HTH,
Bob Barrows


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 
D

Dave Anderson

Bob said:
The target attribute can be changed dynamically using client-side
code. Please go to a dhtml or scripting group for future help with
this.

I would change the INPUT from a Submit to a Button, and use this in
the onclick event:

var oForm =document.getElementByID("form_id")
oForm.target="_blank"
oForm.submit()

Don't forget to reset the target afterward, or all buttons will adopt the
"new window" behavior. For example:

oForm.target = "_blank"
oForm.submit()
oForm.target = self



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
B

Bob Barrows [MVP]

Dave said:
Don't forget to reset the target afterward, or all buttons will adopt
the "new window" behavior. For example:

:)
I left that as an exercise for the reader.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,151
Messages
2,570,854
Members
47,394
Latest member
Olekdev

Latest Threads

Top