Skip to main content
Participant
September 19, 2013
Question

Coldfusion forms being injected with Javascript code

  • September 19, 2013
  • 1 reply
  • 1994 views

I created simple Coldfusion forms for online use that have been working for a long time with no problems. Suddenly I have been getting blank Coldfusion forms through email along with the valid Coldfusion forms. They are coming in like spam. I noticed that javascript which I didn't have in my form is being added in the head tags after I have uploaded the form to the server. When the valid Coldfusion forms come through email they contain only a portion of the page which is the form field with information entered by the user. The valid forms contain no logo/graphics, etc. When I receive the forms that are blank contain, they contain the whole web page logo/graphics, etc.

I have enclosed 2 images of the script that has been injected into the head tags on one of the forms.

Does Coldfusion add javascript to the head tags after you upload forms to the server as I have never noticed this before?

 

    This topic has been closed for replies.

    1 reply

    Legend
    September 19, 2013

    This is normal if you use CFFORM. I have veered away from using CFFORM and instead use jquery and the validation plug-in. I prefer a little more control over my forms than what CF provided.

    Participant
    September 19, 2013

    So you are saying that Coldfusion normally injects script into the web page after it is uploaded to the server? I can't think of any reason why I am now getting  blank forms also through email and it never ever happened. Do you know of any reasons this could be happening?

    Inspiring
    September 19, 2013

    You're using <cfform>, right? When a <cfform> tag is processed by ColdFusion, it generates an HTML form, and a bunch of JS to make the special <cfform> functionality work.  What you are seeing is completely normal for <cfform>, and it's always been there.

    NB: you really should not be using <cfform>. Just use HTML and JS and do a proper job of it. <cfform> is a really substandard solution for form creation.

    --

    Adam