Skip to main content
March 11, 2011
Question

passing a value to URL

  • March 11, 2011
  • 1 reply
  • 733 views

Hi,

I have to just pass a value[entryid] to a URL. I have tried this without any use. It is just copying the variable rather than its value.

window.location="manage.cfm?action=delete&entryid=entry";

If I <cfoutput> #entryid#</cfoutput>, before the above statement, i am getting the value of entryid as a number[correct]. How do I pass the value to the URL?

Please help.

Thanks,

Vijayvijay77.

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    March 11, 2011

    window.location="manage.cfm?action=delete&entryid=<cfoutput>#entryid#</cfoutput>";

    March 11, 2011

    Hi BKBK,

    Thank you for your quick reply.

    But, it is giving me an error saying "entry" is not defined. I am using this "window.location" statement inside a javascript function.

    This function is getting the value of entry from coldfusion and again after the javascript function, it is passing the value to Coldfusion to process entry value.

    This is my function:

    function ondelete(entry)
                {
                    var a=confirm("Do you want to delete?");
                    if (a==true)
                      {
                          window.location="manage.cfm?action=delete&entryidentry";
                      }
                }

    Thanks in advance for your valuable suggestions.

    Vijayvijay77.

    ilssac
    Inspiring
    March 11, 2011

    Are you sure you are not confusing what happens on the server and what happens on the client?

    Remember the CFML (ColdFusion) is a server side language that will be completly proccessed before ANYTHING is sent to the client.

    JavaScript is a client side language to will run on the client after ColdFusion has finished and moved onto other tasks.

    Where is this 'entry' value coming from?  Is it a value defined in ColdFusion that you want to set into a piece of JavaScript to be sent to the client OR is it a JavaSript value that is being set by some interaction with the user on the client?