2 Replies Latest reply on Mar 29, 2007 9:09 PM by Newsgroup_User

    Adding DOM element to a CF variable

    shloime11
      Hi,

      I would like to know if it is possible to add a DOM element to a CF variable? Something like this:

      <cfset test = opener.document.MyForm.AFormField.value>

      Any help would be appreciated.

      Shloime
        • 1. Adding DOM element to a CF variable
          insuractive Level 3
          It sounds like you are confusing client-side technology and server-side technology.

          Coldfusion only deals with server-side technology - mainly information that has been submitted via a form or url request to the server. CF generates a page and then presents it to the browser. CF doesn't really have that much interaction with the data on the page until another request comes in (i.e. after form submission, a link is clicked, etc)

          Client side technology such as JavaScript allows you to interact with the contents of your page before the information has been sent to the server. Your DOM example is obviously a JavaScript address for a field on your form. Once you submit the form, CF will have access to it in the FORM scope structure. Until then, however, the only technology that can read/write to that DOM element is client-side technologies such as JavaScript.

          If you can explain a little more about what you are trying to do, we can probably start you down the right path to figuring out what you need to do.
          • 2. Re: Adding DOM element to a CF variable
            Level 7
            insuractive wrote:
            > Coldfusion only deals with client-side technology - mainly information that

            i do believe that is a typo and you meant server-side technology :)

            --

            Azadi Saryev
            Sabai-dee.com
            http://www.sabai-dee.com