Help - Search - Members - Calendar
Full Version: Question about an email function in a Web Gallery
HTMLHelp Forums > Programming > Server-side Scripting
paul4ut
I created a Web Gallery at: http://modeonmain.com/forsale.html

I used Adobe Bridge's built-in function which creates a Photoshop Web Gallery.

Everything works great except for one thing. When I click the "E-Mail Feedback" button, nothing happens. For a while, I was getting an blank email message to appear (as it should), but the address line had more than the web address. The source code in ThumbnailFrame.html looks like this:

function sendFeedback(picName) {
checkForUnSavedChanges(picName);
var prefix = "mailto:gjobes@beecreek.net";
var name = null;
name = prompt("Enter Your Name:", "Your Name");
if (name) {
prefix += "subject=" + escape("Feedback from " + name);
prefix += "&body=";
var str = ""
for (var i in feedback) {
str += i + " ~~ \n";
str += (feedback[i].approved == true) ? "Approved ~~ \n" : "";
str += (feedback[i].other == true) ? "Other ~~ \n" : "";
str += (feedback[i].comments != "") ? ("\nComments:\n" + feedback[i].comments + " ~~ \n") : "";
str += "____________________________________________\n\n";
}


By looking at the source code above, can someone tell me how I can get an email message window to load?

Thanks!
Jeremy Howell
With HTML:

CODE

<a href="mailto:null@some_mail.com">Email</a>


~ Jeremy
paul4ut
Jeremy, thanks for your feedback. I am not sure what you want me to do with the code you sent. I replaced one line with your recommendation, but the email function still does not work. This is the way I made the change:


function sendFeedback(picName) {
checkForUnSavedChanges(picName);

<a href="mailto:gjobes@beecreek.net">Email</a>
var name = null;
name = prompt("Enter Your Name:", "Your Name");

if (name) {
prefix += "subject=" + escape("Feedback from " + name);
prefix += "&body=";
var str = ""

for (var i in feedback) {

str += i + " ~~ \n";
str += (feedback[i].approved == true) ? "Approved ~~ \n" : "";
str += (feedback[i].other == true) ? "Other ~~ \n" : "";
str += (feedback[i].comments != "") ? ("\nComments:\n" + feedback[i].comments + " ~~ \n") : "";
str += "____________________________________________\n\n";

}

If you go to this link: http://modeonmain.com/forsale.html

...and click "FEEDBACK," you will see nothing happens when I click the "E-Mail Feedback" button.

- Paul
pandy
Turn debugging on in your browsers. That's a start anyway. wink.gif

IE tells me the following.
CODE
Runtime error
Line 42
Error: 'ckecked' is null or not an object


It marks this line-
CODE
else if ((top.TopFrame.document.forms["wpgFeedback"].elements["approved"].checked != false && !feedback[picName])
                    || (feedback[picName] && feedback[picName].approved != top.TopFrame.document.forms["wpgFeedback"].elements["approved"].checked))



Opera says this.
CODE

JavaScript - http://modeonmain.com/pages/IMG_0009.html
Event thread: click
Error:
name: TypeError
message: Statement on line 37: Could not convert undefined or null to object
Backtrace:
  Line 37 of inline#1 script in http://modeonmain.com/ThumbnailFrame.html
    feedback[picName].approved = top.TopFrame.document.forms["wpgFeedback"].elements["approved"].checked ? true : false;
  Line 112 of inline#1 script in http://modeonmain.com/ThumbnailFrame.html
    addComment(picName);
  Line 64 of inline#1 script in http://modeonmain.com/ThumbnailFrame.html
    checkForUnSavedChanges(picName);
  Line 1 of  script
    top.BottomFrame.sendFeedback("IMG_0009.jpg");
  At unknown location
    [statement source code not available]


I'll move this to the JavaScript forum.


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.