Change target of form AFTER submit

D

David Adams

Hi,

I have an aspx page that has a series of radio buttons that are
autopostback. When a selection is made, the form posts back and displays
specific input fields for the radio button selected. After the input fields
have been filled out, a button is clicked that changes the target of the
form to "_blank" and posts back - opening a new page where the input fields
are used to create a pdf document. The problem is getting the target of the
form back to nothing so that if the user clicks another radio button (or
something else on the page that posts back) it does not open a new window.
With javascript, I have tried the following:

document.forms[0].target='_blank';
document.getElementById('{0}').click();
document.forms[0].target='';

and

document.forms[0].target='_blank';
__doPostBack('btnPDF','');
document.forms[0].target='';

....but the JS does not work as intended. I don't want to have to change the
target of the form back every time I would normally post back - I want to be
able to change it after the form is submitted. Ideally, I'd like to have a
"afterSubmit" event for the form!

Any ideas?

Thanks,
Dave
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top