W3C home > Mailing lists > Public > www-forms@w3.org > January 2007

Re: setting xforms control value with javascript

From: Iņaki Salinas Bueno <inksalinas@gmail.com>
Date: Mon, 22 Jan 2007 21:13:32 +0100
Message-ID: <cd3c31800701221213j4294e18ey254402f5cc849cf7@mail.gmail.com>
To: www-forms <www-forms@w3.org>
I found a problem using the crypto.signText function of Javascript.

Given this code:

    <script language="javascript">
        function sign() {
            var model = document.getElementById("request");
            var instance = model.getInstanceDocument("signedDoc");
            var textElements = instance.getElementsByTagName("signature");
            textElements[0].firstChild.nodeValue = crypto.signText(
document.getElementById('form').innerHTML, "auto");

    <xforms:model id="request">
        <xforms:instance id="signedDoc">
        <xforms:bind nodeset="instance('signedDoc')/signature"

    <div id="form">


        <xforms:label>To sign the form</xforms:label>
        <xforms:load resource="javascript:sign()" ev:event="DOMActivate"/>

    <xforms:textarea bind="signature">
        <xforms:label>Signed form (PKCS#7 format)</xforms:label>

It doesn't work. The element 'signature' of the instance must have some
value, although it is blank. Therefore:
      <signature> </signature>

Received on Monday, 22 January 2007 20:13:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:19 UTC