Infopath 2007 text box do not take numeric format - InfoPath Dev
in

InfoPath Dev

Infopath 2007 text box do not take numeric format

Last post 01-20-2011 05:10 PM by andresmherrera. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-20-2011 03:09 PM

    Infopath 2007 text box do not take numeric format

    Hi all, I'm working with InfoPath 2007 (no-code) form which has couple a text boxes where the user type numbers. I tried to set number format but the format button on text box's window property is disable, I don not why.
    Then I saved form using infopaht option "Save as sources files" and I tried to edit view1.xsl to set format like this:

    <xsl:when test="function-available('xdFormatting:formatString')"> <xsl:value-of select="xdFormatting:formatString(ValorCompensacion,"number","numDigits:2;negativeOrder:1;")"/> </xsl:when>

    Really I only changed numDigits:4 to numDigits:2.
    When running the infopath form in browser and type 12345,6 the number looks like 12345,6000 (4 decimal digits) even after view1.xsl file change. If the user type 12345,6 I hope looks like 12.345,60. In same server exists others infopath 2007 form that work fine.
    Can someone help me?
    I'm not a great English writer, sorry if there are mistakes.
    Andres Herrera
    MTC MOSS
  • 01-20-2011 04:00 PM In reply to

    Re: Infopath 2007 text box do not take numeric format

    Hey, Andres, welcome.

    How odd that the format text box is disabled.

    When I look at the XSL for a form that has a control with the format defined, the format is in two places. In the when test (as shown in your post) but also in the xd:datafmt attribute of the span tag for the control. The quotes are encoded (&quot;).

    So, in my sample, which is formatted a bit differently than yours, prior to the xsl:when, I have this:

    <span hideFocus="1" class="xdTextBox xdBehavior_Formatting" title="" contentEditable="true" tabIndex="0" xd:CtrlId="CTRL2" xd:xctname="PlainText" xd:binding="@type" xd:datafmt="&quot;number&quot;,&quot;numDigits:0;negativeOrder:1;&quot;" xd:boundProp="xd:num" style="WIDTH: 130px">

    I wonder if you also need to adjust the number format there?

     

    Hilary Stoupa

  • 01-20-2011 05:10 PM In reply to

    Re: Infopath 2007 text box do not take numeric format

    Hey Hilary, Thank you for response. Your solution works fine, decimal places and format. Thanks a lot.
    Andres Herrera
    MTC MOSS
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.