I'm not sure where you are trying to reference closeboxflag2 from but from the looks of your code, you are mixing things that shouldn't be mixed. The following works:
<script language="javascript" type="text/javascript"> var closeboxflag = false; var closeboxflag = ""; closeboxflag = confirm("Are you sure you want to close?") if (closeboxflag == true) { closeboxflag2 = "true"; } else { closeboxflag2 = "false"; } </script> Jonathan Hicks wrote: > hi, i was wondering if you could help me with this problem. I need to set > the variable "closeboxflag2" to "true" only if the user hits the OK button > from the javascript confirm box, or "false" if the user hits cancel. > > <script language="JavaScript" type="text/javascript"> > <cfoutput> > var closeboxflag = false > closeboxflag = confirm("Are you sure you want to close?") > if (closeboxflag == true) { > <cfset closeboxflag2 = "true"> > } else { > <cfset closeboxflag2 = "false"> > } > </cfoutput> > </script> > > Thanks, Jon > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254065 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4