save a different value of an input field

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

save a different value of an input field

aminul
Hi all

i've a read only status input field which will load initially with 'new'. I want to set/change/submit this value with 'submitted' when user click the save/submit button and see the 'submitted' value when he want to edit this form or view submission.
So, how i can submit a different value for an read only input field to show and maintain the status and/or role of a form.?
thanks in advance..?
Reply | Threaded
Open this post in threaded view
|

Re: save a different value of an input field

aminul
Hi all..

with the help of
http://wiki.orbeon.com/forms/doc/developer-guide/xforms-javascript-integration#TOC-Getting-and-Setting-Controls-Value-
i'm able to set 'status' input control from 'new' to 'draft'/'submitted' when click to save/submit button. But the submission send the previous value of the input field ('new') and not 'draft' or 'submitted' which i want to store for that control.

<fr:button id="fr-save-button" model="fr-persistence-model"
                           ref="instance('fr-triggers-instance')/"save>
                        <xforms:label> <xhtml:img width="16" height="16" src="/apps/fr/style/images/silk/database_save.png"  alt=""/>
    <xhtml:span>
          <xforms:label>Save it to</xforms:label>
                            </xhtml:span>
                        </xforms:label>
                    <xforms:action ev:event="DOMActivate">
     
                        <xxforms:script>
    ORBEON.xforms.Document.setValue("status-control", "draft");
   </xxforms:script>
                    </xforms:action> 
                    </fr:button>