Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7444787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:35:17+00:00 2026-05-29T11:35:17+00:00

Have a simple contact us XPage created. Have server side validation in place that

  • 0

Have a simple “contact us” XPage created.

Have server side validation in place that displays errors via ‘Display Error’ controls.
Have button that sends out email when clicked.

Functionality works using Firefox 4.0.1, but does not with IE8.

Have put the following compatibility code in the beforeRenderResponse event:

try {
if (context.getUserAgent().isIE(8, 8)) {
var exCon = facesContext.getExternalContext();

var response = exCon.getResponse();
response.setHeader("X-UA-Compatible", "IE=EmulateIE7");
}
} catch (e) {
}

Does not seem to help. Any ideas/suggestions?

Derek

Update:

As requested – here’s the button code:

var doc = database.createDocument();
doc.replaceItemValue("Form", "Memo");
doc.replaceItemValue("Subject", "Contact Us Received");
doc.replaceItemValue("SendTo", "detnyre@mac.com");
doc.replaceItemValue("DisplaySent","detnyre@mac.com");

//Build Body

var1 = "The following Contact Us message was received: <br><br>";
var2 = var1 + "Contact Name: " + document1.getItemValueString("ContactName").valueOf()+ "<br><br>";
var3 = var2 + "Email Address: " + document1.getItemValueString("ContactEmail").valueOf()+ "<br><br>";
var4 = var3 + "Phone Number: " + document1.getItemValueString("ContactPhone").valueOf() + "<br><br>";
var5 = var4 + "Subject: " + document1.getItemValueString("ContactSubject").valueOf() + "<br><br>";
var6 = var5 + "Message: " + document1.getItemValueString("ContactMessage").valueOf() + "<br>";

body = doc.createMIMEEntity()
stream = session.createStream()
stream.writeText(var6)
body.setContentFromText(stream, "text/html; charset=iso-8859-1", 0)

// Send
doc.send();
context.redirectToPage("Home")

Here’s the XML generated:

<xp:button value="Email Test" id="button2">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:var doc = database.createDocument();
doc.replaceItemValue("Form", "Memo");
doc.replaceItemValue("Subject", "Contact Us Received");
doc.replaceItemValue("SendTo", "detnyre@mac.com");
doc.replaceItemValue("Princial","detnyre@mac.com");
doc.replaceItemValue("ReplyTo","detnyre@mac.com");
doc.replaceItemValue("tmpDisplaySentBy","detnyre@mac.com");
doc.replaceItemValue("DisplaySent","detnyre@mac.com");
doc.replaceItemValue("From","DonahueOnline")

//Build Body
var1 = "The following Contact Us message was received: <br><br>";
var2 = var1 + "Contact Name: " + document1.getItemValueString("ContactName").valueOf()+ "<br><br>";
var3 = var2 + "Email Address: " + document1.getItemValueString("ContactEmail").valueOf()+ "<br><br>";
var4 = var3 + "Phone Number: " + document1.getItemValueString("ContactPhone").valueOf() + "<br><br>";
var5 = var4 + "Subject: " + document1.getItemValueString("ContactSubject").valueOf() + "<br><br>";
var6 = var5 + "Message: " + document1.getItemValueString("ContactMessage").valueOf() + "<br>";

body = doc.createMIMEEntity()
stream = session.createStream()
stream.writeText(var6)
body.setContentFromText(stream, "text/html; charset=iso-8859-1", 0)

// Send
doc.send();
context.redirectToPage("Home")

}]]></xp:this.action>
    </xp:eventHandler>
</xp:button>

Derek

============

Update #2

Moved the code from the button to the query save event. Same result – works in Firefox, but not IE8. Assume I have something basic wrong, just can’t find it… Here is new source code:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">


<xp:this.beforeRenderResponse><![CDATA[#{javascript:try {
if (context.getUserAgent().isIE(8, 8)) {
var exCon = facesContext.getExternalContext();
var response = exCon.getResponse();
response.setHeader("X-UA-Compatible", "IE=EmulateIE7");
}
} catch (e) {
}}]]></xp:this.beforeRenderResponse>
<xp:br></xp:br>
<xp:this.data>
    <xp:dominoDocument var="document1" formName="CUF">
        <xp:this.querySaveDocument><![CDATA[#{javascript:var doc = database.createDocument();
doc.replaceItemValue("Form", "Memo");
doc.replaceItemValue("Subject", "Contact Us Received");
doc.replaceItemValue("SendTo", "detnyre@mac.com");
doc.replaceItemValue("Princial","detnyre@mac.com");
doc.replaceItemValue("ReplyTo","detnyre@mac.com");
doc.replaceItemValue("tmpDisplaySentBy","detnyre@mac.com");
doc.replaceItemValue("DisplaySent","detnyre@mac.com");
doc.replaceItemValue("From","DonahueOnline")

//Build Body
var1 = "The following Contact Us message was received: <br><br>";
var2 = var1 + "Contact Name: " + document1.getItemValueString("ContactName").valueOf()+ "<br><br>";
var3 = var2 + "Email Address: " + document1.getItemValueString("ContactEmail").valueOf()+ "<br><br>";
var4 = var3 + "Phone Number: " + document1.getItemValueString("ContactPhone").valueOf() + "<br><br>";
var5 = var4 + "Subject: " + document1.getItemValueString("ContactSubject").valueOf() + "<br><br>";
var6 = var5 + "Message: " + document1.getItemValueString("ContactMessage").valueOf() + "<br>";

body = doc.createMIMEEntity()
stream = session.createStream()
stream.writeText(var6)
body.setContentFromText(stream, "text/html; charset=iso-8859-1", 0)

// Send
doc.send();
context.redirectToPage("Home")

}]]></xp:this.querySaveDocument></xp:dominoDocument>
</xp:this.data>
<xp:table
    style="margin-top:5.0px;margin-bottom:5.0px;padding-top:5.0px;padding-bottom:5.0px">
    <xp:tr>
        <xp:td>
            <xp:span style="font-size:16pt">Contact Us</xp:span>
        </xp:td>
    </xp:tr>
    <xp:tr>
        <xp:td></xp:td>
    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">
            * (denotes required field)
        </xp:td>
    </xp:tr>
    <xp:tr>
        <xp:td></xp:td>
    </xp:tr>
    <xp:tr>
        <xp:td style="width:400px;font-size:12pt">
            Name:*
            <xp:message id="ContactNameError" for="ContactName"
                style="color:rgb(255,128,128);font-size:9pt">
            </xp:message>
        </xp:td>

    </xp:tr>

    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactName"
                value="#{document1.ContactName}" style="width:200px"
                required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Name is required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
            <xp:br></xp:br>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">
            Email Address:* &#160;
            <xp:message id="message1"
                style="color:rgb(255,0,0);font-size:9pt" for="ContactEmail">
            </xp:message>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactEmail" style="width:200px"
                value="#{document1.ContactEmail}" required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Email Address is Required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">Phone Number:</xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactPhone" style="width:200px"
                value="#{document1.ContactPhone}" required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Phone Number is Required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
            <xp:br></xp:br>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">
            Subject:* &#160;
            <xp:message id="message2"
                style="color:rgb(255,0,0);font-size:9pt" for="ContactSubject">
            </xp:message>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactSubject" style="width:300px"
                value="#{document1.ContactSubject}" required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Subject is required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">
            Message:* &#160;
            <xp:message id="message3"
                style="color:rgb(255,0,0);font-size:9pt" for="ContactMessage">
            </xp:message>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputTextarea id="ContactMessage"
                style="height:250px;width:99%" value="#{document1.ContactMessage}"
                required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="A message is required.">
                    </xp:validateRequired>

                </xp:this.validators>
            </xp:inputTextarea>
        </xp:td>

    </xp:tr>
</xp:table>


<xp:br></xp:br>
<xp:button value="Submit" id="button1"><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
    <xp:saveDocument var="document1"></xp:saveDocument>
</xp:this.action></xp:eventHandler></xp:button></xp:view>

==========

UPDATE #3

Tried the suggestions posted. Removed the code that set compatibility mode of IE8. Re-did the button. Included save=”false” in the button code. Still works in FireFox, but not with IE8. IE8 displays page, but validation and email code does not run… odd…

Here is latest source code:

<xp:br></xp:br>
<xp:this.data>
    <xp:dominoDocument var="document1" formName="CUF">
        <xp:this.querySaveDocument><![CDATA[#{javascript:var doc = database.createDocument();

doc.replaceItemValue(“Form”, “Memo”);
doc.replaceItemValue(“Subject”, “Contact Us Received”);
doc.replaceItemValue(“SendTo”, “detnyre@mac.com”);
doc.replaceItemValue(“Princial”,”detnyre@mac.com”);
doc.replaceItemValue(“ReplyTo”,”detnyre@mac.com”);
doc.replaceItemValue(“tmpDisplaySentBy”,”detnyre@mac.com”);
doc.replaceItemValue(“DisplaySent”,”detnyre@mac.com”);
doc.replaceItemValue(“From”,”DonahueOnline”)

//Build Body
var1 = “The following Contact Us message was received:

“;
var2 = var1 + “Contact Name: ” + document1.getItemValueString(“ContactName”).valueOf()+ “

“;
var3 = var2 + “Email Address: ” + document1.getItemValueString(“ContactEmail”).valueOf()+ “

“;
var4 = var3 + “Phone Number: ” + document1.getItemValueString(“ContactPhone”).valueOf() + “

“;
var5 = var4 + “Subject: ” + document1.getItemValueString(“ContactSubject”).valueOf() + “

“;
var6 = var5 + “Message: ” + document1.getItemValueString(“ContactMessage”).valueOf() + “
“;

body = doc.createMIMEEntity()
stream = session.createStream()
stream.writeText(var6)
body.setContentFromText(stream, “text/html; charset=iso-8859-1”, 0)

// Send
doc.send();
context.redirectToPage(“Home”)

}]]>

Contact Us

* (denotes required field)

Name:*

    </xp:tr>

    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactName"
                value="#{document1.ContactName}" style="width:200px"
                required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Name is required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
            <xp:br></xp:br>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">
            Email Address:* &#160;
            <xp:message id="message1"
                style="color:rgb(255,0,0);font-size:9pt" for="ContactEmail">
            </xp:message>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactEmail" style="width:200px"
                value="#{document1.ContactEmail}" required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Email Address is Required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">Phone Number:</xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactPhone" style="width:200px"
                value="#{document1.ContactPhone}" required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Phone Number is Required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
            <xp:br></xp:br>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">
            Subject:* &#160;
            <xp:message id="message2"
                style="color:rgb(255,0,0);font-size:9pt" for="ContactSubject">
            </xp:message>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputText id="ContactSubject" style="width:300px"
                value="#{document1.ContactSubject}" required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="Subject is required.">
                    </xp:validateRequired>
                </xp:this.validators>
            </xp:inputText>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td style="font-size:12pt">
            Message:* &#160;
            <xp:message id="message3"
                style="color:rgb(255,0,0);font-size:9pt" for="ContactMessage">
            </xp:message>
        </xp:td>

    </xp:tr>
    <xp:tr>
        <xp:td>
            <xp:inputTextarea id="ContactMessage"
                style="height:250px;width:99%" value="#{document1.ContactMessage}"
                required="true">
                <xp:this.validators>
                    <xp:validateRequired
                        message="A message is required.">
                    </xp:validateRequired>

                </xp:this.validators>
            </xp:inputTextarea>
        </xp:td>

    </xp:tr>
</xp:table>


<xp:br></xp:br>
<xp:button value="Label" id="button1">
<xp:eventHandler event="onclick" submit="true" save="false" refreshMode="complete">
<xp:this.action>
    <xp:saveDocument var="document1"></xp:saveDocument>
</xp:this.action>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:35:19+00:00Added an answer on May 29, 2026 at 11:35 am

    Without the actual code it’s hard to diagnose the problem. It might be related to not setting the correct button type, which works in Firefox, but breaks IE. See this blog post I wrote about that:

    http://blog.thimojansenit.nl/2011/06/fix-default-type-for-submit-buttons-in.html

    (edit) In this case, after seeing the code, try it with ‘save=”false”‘ added to the eventHandler. Like this:

    <xp:button value="Submit" id="button1">
    <xp:eventHandler event="onclick" submit="true" save="false" refreshMode="complete">
        <xp:this.action>
            <xp:saveDocument var="document1"></xp:saveDocument>
        </xp:this.action>
    </xp:eventHandler>
    

    For me this does the trick when IE is not behaving the same as Firefox on a submit event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have created simple Ajax enabled contact forms before that have around 12 fields -
I have written a simple contact manager application that uses a UITableView to display
I have a simple contact form with Subject and Message that I want to
I have a simple cakephp form WITH validation that submits to a database. It
I have a simple contact form that works in every browser, except IE. It
I have a simple contact form on a website that has 2 text fields,
i have developed a simple php contact form, that's working fine, but i am
We have a simple domain model: Contact, TelephoneNumber and ContactRepository. Contact is entity, it
I have simple win service, that executes few tasks periodically. How should I pass
I have a simple contact form thats throwing up an Notice: Undefined index: e

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.