Skip to main content
Inspiring
September 19, 2006
Question

Using popups in ColdFusion

  • September 19, 2006
  • 2 replies
  • 589 views
With CF, to display something, I would do <cfoutput>#session.order_number#</cfouput> to display the value of order number.

I have a javascript popup in my action page to display a message as soon as my form is submitted, which works fine. How can I get the value of order number to dispaly in the popup also, is that even possible ?

thanks
    This topic has been closed for replies.

    2 replies

    Inspiring
    September 20, 2006
    how you go about it depends on how the order number is selected on your form page.
    if the form page already knows the order number when it loads (i.e. the order was selected on a previous page and then passed to the form page as a url variable or in some other way), then you can just use your cfoutput inside the javascript's alert text.
    if the order is selected on the form page after it loads. then you need to store the order number as a javascript variable of in a (hidden) form field. with the form field option, if an order is selected in a form field (i.e. in a drop-down select list or a checkbox), then you can
    1) access that form field's value in your javascript alert
    or
    2) add a onChange or onClick event to that form field and write a javascript function that will store the selected order number somewhere (i.e. in a variable or another form field), and then use that variable or form field value in your alert code.

    feel free to PM me with your full page code and i will help you decide which way to go and write the appropriate code, if you want to.
    Inspiring
    September 20, 2006
    You can either add it to the popup url as a url value pair or as well as displaying it have a hidden form field and then access the value of the hidden form field from the popup

    Ken