Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variable problem

Status
Not open for further replies.

mimi2

Technical User
Apr 2, 2002
407
CA
i am trying to built a preview page (for many days) !!
i am trying to pass my filled form variables from page main.cfm to previewrequest.cfm (coldfusion pages).
i just can't open my new window!! i now that's certainly related to javascript.
can you tell me what's wrong with my code ?
thanks

main.cfm

<script language=&quot;javascript&quot;>
function WinOpen(form,xurl,x,y) {
var options = &quot;toolbar=no,scrollbars=yes,resizable=yes,width=&quot; + x + &quot;,height=&quot; + y;
var tempVar = &quot;&quot;;
for (i = 1; i < document.form.length; i++)
{ tempVar += &quot;&&quot; + &quot;#&quot;+ document.form.elements.value + &quot;#&quot;;}
thisurl = xrul + &quot;?thisvar1=&quot; + &quot;#&quot; + document.form.elements[0].value + &quot;#&quot; + tempVar;
msgWindow=window.open(thisurl,&quot;WinOpen&quot;,options);
}
</script>
<INPUT TYPE=BUTTON name=&quot;Preview&quot; VALUE=&quot;Preview&quot; onclick=&quot;WinOpen(this,'PreviewRequest.cfm','710','500')&quot;>

PreviewRequest.cfm

<CFOUTPUT>
thisvar1 = #thisvar1#
</CFOUTPUT>


 
first of all, form is a reserved javascript word.
second, when you call the function, the number don't need the quotes.

See if that fixes it.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top