jQuery/ColdFusion : Preview vs Submit

Hello, everyone,

I’ve been working on this for several hours, now, and I’m just about to start pulling out my hair. :slight_smile:

I’ve got a form that will allow the user to type a short note that will be sent in an email, along with the display of anywhere from 1 to 10 article headlines pulled from a database.

If the SEND button is clicked, it formats an email and sends it with the note, and the headlines.

There is also a PREVIEW button, so the sender can see what the email will look like, when sent.

Currently, I’m using $.post() to submit the data behind the scenes (works great), open a blank window (also works great) and populate the new window with the data displayed after the submit (works great, except no images.)

Any suggestions? I’ll try to provide some code.

jQuery:


$form = $('#formName');
$.ajax(
    type: "POST",
    url: "email_layout.cfm",
    data: $form.serialize(),
    success: function(data){
        var w = window.open();
        $(w.document.body).html(data);
        }
    });

In “email_layout.cfm” is a section that has <img src=“/path/to/logo.gif” style=“margin-right:20px;” /> The logo is the only thing not showing. Everything else is working as expected.

Any ideas?

Thanks,

:slight_smile:

Hi,

Are there any errors showing in your browser’s console?
Could you provide a ink to a page where I can see this not working?

Hi, Pullo,

Thanks for your reply.

Unfortunately, I am on a restricted network that is isolated from the internet, so I cannot provide a link. Also just as sad is the fact that the network admins block sites like jfiddle, so I can’t provide code, there. (I can’t even get to github.)

The PTB, here, have recently decided that the logo isn’t important. So I’ve been instructed to just comment out that code and let the rest be. Which is kind of disappointing, as I dislike letting a computer kick my butt… but I have to move on to another project. :frowning:

V/r,

:slight_smile:

Hey,

No probs :slight_smile:

You and me both.
I’m always of the opinion that the computer should do what I want and not the other way round.