I have an Asp.NET FileUpload control on the page (which renders as an <input type="file> HTML element) and a submit button along with an IFrame.
I am attempting to redirect the form's target into the IFrame.
I have the following JavaScript function which should redirect the form's action into an Iframe on the page:
Expand|Select|Wrap|Line Numbers
- function redirectFormAction(iframeTargetID) {
- var theForm = document.forms['theFormsID'];
- theForm.target = iframeTargetID;
- }
Expand|Select|Wrap|Line Numbers
- <input id="fup" type="file" style="width: 222px;" name="fup"/>
- <input id="upload" type="submit" style="width: 222px;" onclick="ChangeHasOccurred(); AllowPostback('xyz'); redirectFormAction('ctl00_theiframe');" value="Preview" name="upload"/>
- <iframe id="ctl00_theiframe" src="#" name="ctl00_theiframe">
- </iframe>
-Frinny