Welcome Guest, Not a member yet? Register   Sign In
Send a photo, with preview - URGENT
#1

[eluser]Boris Strahija[/eluser]
I'm having some troubles with a app that send photos via email.
I have a form (name, email, file upload) when clicking on the send button everything works fine.
But I also have a preview link. This link should submit the form into a new window.
Does anyone have an idea how to do this, most of the browsers work flawless, but IE6 wont work at all.
I'm trying to change the target and action attributes via javascript.
Is there a better way to do this?
#2

[eluser]Flemming[/eluser]
Are you using jQuery to change the target and action?

Just wondering if you could use jQuery.ajax() to post the data to your preview while leaving your existing form alone?
#3

[eluser]jedd[/eluser]
Urgency is in the eye of the beholder. Usually declaring your problem to be more important than other people's, when seeking free help, is an effective way of being ignored. Just for future reference.

[quote author="Boris Strahija" date="1260999402"]
I'm having some troubles with a app that send photos via email.
[/quote]

Usual trouble-shooting questions (though it's better if you [url="/wiki/How_to_ask_a_good_question/"]include more detail up front[/url])
- did it used to work?
- if so, what has changed?
- what have you done so far to resolve the problem? With what results?

Quote:Does anyone have an idea how to do this, most of the browsers work flawless, but IE6 wont work at all.
I'm trying to change the target and action attributes via javascript.

It sounds like an IE6 with JavaScript problem - IE6 is a pretty shonky and out-dated browser with many known bugs.

In what way do you believe that CodeIgniter is involved?
#4

[eluser]Boris Strahija[/eluser]
Yes I know about the "urgent" part, I usually don't do that. It's just I didn't get much sleep and I'm on a deadline Wink

The whole app runs on CI, so it has something to do with it Smile I'm using the CI form validation, upload and image manipulation libraries.
My question is actually what is the best way to pull off something like I'm trying. It should work in IE6 also. I know it's outdated, but the client wants it.

@flemming
How could I upload a photo with Ajax? I know about plugins, but I don't think it is possible with with plain ajax()
#5

[eluser]Flemming[/eluser]
OK forget my first suggestion! You're basically just sending all the form data to a different method for the preview, so that's fine and nothing weird or tricky about that ... so what exactly is the problem you're experiencing with that god-forsaken sorry excuse for a browser that is IE6?
#6

[eluser]Boris Strahija[/eluser]
I think I've found the sollution finally. The problem were the JQuery methods.
Not working:
Code:
$("#sendphoto").attr("target", "_blank");
$("#sendphoto").attr("action", "/cestitka/prikaz");

Working:
Code:
document.sendphoto.action = "/cestitka/prikaz";
document.sendphoto.target = "_blank";

For some reason the JQuery part works in all browsers except for IE6.




Theme © iAndrew 2016 - Forum software by © MyBB