PDA

View Full Version : Web Page Dialog Submitting to Itself


aaronjudson
06-22-2005, 09:28 PM
hey,

the following code is used in a web page dialog. it is used to upload files. what i need is the page to submit to itself then close. it worked fine when it wasnt in a web page dialog but now that it is it opens up a new window.

The Code:

<CFIF isDefined("Form.FieldNames")>
<CFIF #form.txtImage0# NEQ "">
<CFFILE ACTION="UPLOAD"
FILEFIELD="txtImage0"
DESTINATION="e:\can\english\cs\content\news\"
NAMECONFLICT="Overwrite">
</CFIF>
<CFIF #form.txtImage1# NEQ "">
<CFFILE ACTION="UPLOAD"
FILEFIELD="txtImage1"
DESTINATION="e:\can\english\cs\content\news\"
NAMECONFLICT="Overwrite">
</CFIF>
<CFIF #form.txtImage2# NEQ "">
<CFFILE ACTION="UPLOAD"
FILEFIELD="txtImage2"
DESTINATION="e:\can\english\cs\content\news\"
NAMECONFLICT="Overwrite">
</CFIF>


<CFELSE>

<FORM METHOD="post" action="upload.cfm"NAME="addForm" enctype="MULTIPART/FORM-DATA">
<TABLE BORDER="1" BORDERCOLOR="#CCCCDE" CELLSPACING="0" CELLPADDING="3" BORDERCOLORLIGHT="#DCE1E7" WIDTH="610">
<TR>
<TD WIDTH="100%" CLASS="backgroundlight">
<TABLE WIDTH="100%" BORDERCOLOR="#FFFFFF" BORDERCOLORLIGHT="#B0B0CC" CELLPADDING="2" CELLSPACING="0" BORDER="1">
<TR>
<TD ALIGN="center">
<INPUT NAME="txtImage0" TYPE="file" SIZE="50">
</TD>
</TR>
<TR>
<TD ALIGN="center">
<INPUT NAME="txtImage1" TYPE="file" SIZE="50">
</TD>
</TR>
<TR>
<TD ALIGN="center">
<INPUT NAME="txtImage2" TYPE="file" SIZE="50">
</TD>
</TR>
<TR>
<TD ALIGN="center">
<INPUT TYPE="Submit" NAME="Action" VALUE="Click to Upload these files">
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</FORM>
</CFIF>

i tried writing some javascript to do this but was unsuccesfful, so any help from anyone would be greatly appreciated.

thanks
aaron

glenngv
06-23-2005, 04:21 AM
That's the inherent behavior of Modal dialogs. You can't do something about it. Just use a DHMTL Modal dialogs like this (http://subimage.com/sublog/subModal) or you can google for it for more choices.

aaronjudson
06-23-2005, 01:37 PM
thank you very much, ill try that out and see if it is what im looking for.

aaronjudson
06-23-2005, 02:13 PM
that isnt really what i am looking to do, as i cannot make it suit the theme i am using.

i am going to try submitting to an iframe or using a hidden iframe to do it. if anyone has any suggestions on how to go about this, or if it will even work that would be great.

aaronjudson
06-23-2005, 03:12 PM
there we go

function uploadImg() {
window.showModalDialog("javascript:document.write('<html><head><title>Upload Images</title></head><body><IFRAME

SRC=/english/cs/apps/includes/textarea/TAUpload.cfm NAME=TAUpload WIDTH=619 HEIGHT=143 SCROLLING=no MARGINHEIGHT=0

MARGINWIDTH=0></IFRAME></body></html>')","", "DIALOGHEIGHT:143px; DIALOGWIDTH:619px; HELP:no; SCROLL:no; STATUS:no;");
}

when i called the web page dialog, i just placed an iframe inside, therefore when it submits, it submits back to itself in the iframe and doesnt load another page.

thanks to all for your ideas and help :)