prevent textbox auto reformating? - InfoPath Dev
in

InfoPath Dev

prevent textbox auto reformating?

Last post 02-13-2007 07:10 AM by jackinthegreen. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-12-2007 01:03 PM

    prevent textbox auto reformating?

    Hi,

    I've got a text box that is of format type simpletype and is bound to a queryfield, and when I click on a button that initiates the query it first removes all zero's at the front of the number entered; even though the data type is not numeric. This is a royal pain since the data has the format 001 etc.. and is of a string format in the db. Yes I can write some kind of hack to test and replace the zeros in the the string on button click, but this seems silly to me. Can't I prevent that reformatting onclick via the IP 2003 design interface? BTW, there are no rules or data validations set for this control at all.

    Thanks for any help!
  • 02-12-2007 11:23 PM In reply to

    Re: prevent textbox auto reformating?

    Hello

    Open the Text Box in the design View and select the Data Type to be Whole Number(Numeric)
    Click on the Format at the End of the Data type field
    Select None(Display XML Value) Radio Button in the Integer format window.

    Hope this helps you
    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 02-13-2007 07:10 AM In reply to

    Re: prevent textbox auto reformating?

    Thanks Kaylan!

    My problem was that since the original textbox was created from the main datasource queryfields, it wouldn't allow me to set the datatype. But I had another textbox referencing a custom field I created that did not strip off the zeroes on button click even though it has a text(string) format, so I deleted the queryfield bound textbox, copied and pasted my custom textbox into my first view,bound it to a new custom field, pointed my onclick code at it and, oila, it works great. So it seems to me that the proprietary "simpletype" data type is the culprit. If so, it's another example where the "out of the box" solution is anything but easy when it comes time to customize. :)

    Cheers!
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.