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
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