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 9016857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:07:02+00:00 2026-06-16T04:07:02+00:00

xforms:submit event is raised before the submission happens and any changes to node values

  • 0

xforms:submit event is raised before the submission happens and any changes to node values before submission can be achieved.

I have tried doing this, i could see the value is getting changed on the browser, but the saved node still have the old data. Any idea on this.

<xforms:submission id="save-instance" ref="instance('form-instance')" 
    action="{instance('temp-instance')/submit-url}" method="post" validate="false" replace="none">

    <xforms:action ev:observer="save-instance" ev:event="xforms-submit">
        <xforms:message level="modal" value="'About to Submit'" />
        <xxforms:script>
            ORBEON.xforms.Document.setValue("location-of-dda-id-a", 'Test3');
        </xxforms:script>
    </xforms:action>

    <xforms:action ev:observer="save-instance" ev:event="xforms-submit-done">
        <xforms:message level="modal" ref="instance('metaData')/save-success-msg" />
    </xforms:action>
    <xforms:message ev:event="xforms-submit-error" level="modal" ref="instance('metaData')/save-error-msg" />
</xforms:submission>

And the id location-of-dda-id-a is the id given for an input field.

Basically, i wanted to replace the special characters that are copied and pasted from MS documents. Below is the Js function that can achieve this.

var specialChars = [/\u0011/g, /\u0012/g, /\u0013/g, /\u0014/g, /\u0016/g, /\u2018/g, /\u2019/g, /\u201c/g, /\u201d/g, /\u2026/g, /\u2013/g, /\u2219/g, /\u2022/g,/\u00BF/g];
var specialCharsReplacement = ["", "", "", "", "", "'", "'", "\"", "\"", "...","-","-","-","?"];

function replaceSpecialChars(formName) 
{
    for(i = 0; i < formName.elements.length; i++) 
    {
        if (formName.elements[i].type == 'textarea' || formName.elements[i].type=='text')
        {        
            var commentText = formName.elements[i].value;
            if(commentText != 0) 
            {          
                for(j = 0; j < specialChars.length; j++) 
                {
                    commentText = commentText.replace(specialChars[j], specialCharsReplacement[j]);
                }               
                formName.elements[i].value = commentText;
            }
        }
    }

}

And the line

formName.elements[i].value = commentText;

should be replaced with

ORBEON.xforms.Document.setValue(formName.elements[i].id.split("\$")[0], commentText);

But it is not working.

  • 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-06-16T04:07:03+00:00Added an answer on June 16, 2026 at 4:07 am

    This is a tricky one: you’re correct to say that the xforms-submit action runs before the submission is done, but this happens on the server, and the xxforms:script runs on the browser, after everything else was executed on the server. So you need to be somewhat careful when using xxforms:script.

    In this case, you’re better off using an xforms:setvalue instead of xxforms:script to set the value. (In general, it is better to leave xxforms:script for things that can’t be done in XForms.)

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

Sidebar

Related Questions

I hope some of you XForms gurus can help. I have a large XFroms
I have next problem, when I'm trying to retrieve value from xforms:select elements I
I am wanting to concatenate two nodeset values using XPath in XForms. I know
I have a dropdown to display status, which can be Enabled(true) or Disabled(false). Here
I have a main instance named 'myinstance' which has the element color. Color can
I have a radio button control with two items in it. <xforms:select1 ref=add-delete appearance=full>
In an XForms form, I have a section that repeats with inputs inside of
I have created an Area for XForms and when I try to return view(index.xhtml)
I'm just looking for something that can transform XForms to traditional HTML Forms (or
I could not find a good approach of copying the repeated node values to

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.