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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<cfscript> msgbox

Status
Not open for further replies.

Wes98765

Programmer
Jul 31, 2002
135
0
0
US
how do you create a message box in <cfscript>, I need a yes no msgbox and then I have to create a cookie array with the result. I can't seem to find it on the web or books.

Thanks
 
ColdFusion does not create message boxes, only javascript does. The only way to create a msg box in cfscript would be to use WriteOuput to output javascript to the page.

Something like:

=== START CODE EXAMPLE ===
<cfscript>
WriteOutput('
<script language=&quot;JavaScript&quot;>
<!--

doyou = confirm(&quot;Do you like the ColdFusion? (OK = Yes Cancel = No)&quot;); //Your question.

if (doyou == true)
alert(&quot;Me Too!&quot;); //If your question is answered Yes.
else if (doyou == false)
alert(&quot;*Sniff* *Sniff* Too Bad!&quot;); //If your question is answered No.

//-->
</script>
');

</cfscript>
=== END CODE EXAMPLE === - tleish
 
Thanks that works great. Do you know a way to make the confirm &quot;yes,No&quot; or any other msgbox I can use? I know how to do it in vbscript but this client gets a large number of users so I can't cut out netscape : (.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top