Discussion Locked

Javascript - Capturing IE Message Reply

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is there a way, through Javascript, to capture the Internet Explorer security message response when submitting a form using the Mailto action.

I am doing this for a corporate intranet. All users are on IE 5.01 and using Outlook 2000 for e-mail. ASP pages or CGIs to capture the form data is not allowed. Client-side programming is the only option.

IE 5 will display a security message informing the user the form will be submitted using E-mail and their e-mail address will be revealed. Users need to click OK or Cancel on the message.

I wish to branch to a Thank You web page if users click OK or to a Form Cancelled web page if users click Cancel to the IE security message.

Javascript is:

I have a button with an onclick action that branches to the submitform function.

Using the

if (myform(submit())

statement pauses execution of the script until the users clicks OK or Cancel on the IE security message, but the answer is always false.

Outlook 2000 processes the form data just fine. I would just like a way to send the users a message when they click on the Cancel button.

Is there a way to capture this message and achieve the results I'm looking for?

5 replies

by heartyguffaw

Sorry, the IF statement should have read:

If (myform.submit()) {
location.href = "thanks.htm"}
else {
location.href = "cancelled.htm"}
}

by flynboy

Don't know if this is acceptable, but you don't have to post the form at all, and you can avoid having the security message pop up. This function will both bring up an email with person in the to line, and then redirect to a different page.

then, you don't need the form, just a button to call the function i.e.:

you can change the href in the window.open to add the subject, etc....

by heartyguffaw

Since you are the only one who attempted to answer the question and gave an alternative solution, I'll give you the points on this one. No one from ANY newsgroup I've posted this question on has gone even that far. Usually, the answers have been, use a CGI or ASP page, which is not an option.

I've tried something similar to what you suggested. The problem is, when I include the body of the text into the email, Outlook 2000 ignores the line breaks I insert using "\n" in the javascript code.

I have the ENCTYPE set to "text/plain". When I post the form, the line breaks are read just fine. When I open the e-mail, as in your example, Outlook 2000 ignores the "text/plain" encoding and uses the default e-mail format, usually Rich Textformat, which doesn't recognize the "\n" line breaks. The body of the message is smashed together.

I've just left the form as a "Post", with an explanation on the form about the security message.

I believe the solution to capturing the security message is to create a new ActiveX object pointing the IE application and then to the proper object properties of the security warning message. When I get more time, I'll play with this some more to figure it out. I've seen the same question I posted asked by other people, but no one has ever come up with an answer.

I do APPRECIATE you taking the time to post a suggestion.

This discussion is closed to new replies.