help! textbox strips out trailing period problem

M

Miles

I have a simple textbox on an infopath form to enter an invoice amount. The
customer wants to have all sorts of custom logic appied to the text, for
example typing in "555" results in $5.55, typing in "555." results in
$555.00. Typing in "55555" results in $555.55". Saves them time they
say--don't ask.

In any case, I have the logic in place, but I find that infopath strips out
a trailing period automatically for numeric values. For example, when I set
a break point in the code, if you type "123.00" then you get "123.00", but if
you type "123." then you get "123" without the trailing period.
Interestingly, if you type "abc." then you do get "abc." with the period.
Has anyone seen this or have a workaround for it? I actually want the
trailing period as I need to apply custom logic to the value based on the
fact that it has a trailing period.

Thanks in advance
 
S

Steve van Dongen [MSFT]

I have a simple textbox on an infopath form to enter an invoice amount. The
customer wants to have all sorts of custom logic appied to the text, for
example typing in "555" results in $5.55, typing in "555." results in
$555.00. Typing in "55555" results in $555.55". Saves them time they
say--don't ask.

I believe that's fairly common.
In any case, I have the logic in place, but I find that infopath strips out
a trailing period automatically for numeric values. For example, when I set
a break point in the code, if you type "123.00" then you get "123.00", but if
you type "123." then you get "123" without the trailing period.
Interestingly, if you type "abc." then you do get "abc." with the period.
Has anyone seen this or have a workaround for it? I actually want the
trailing period as I need to apply custom logic to the value based on the
fact that it has a trailing period.

Sounds like you are using a numeric field type. You'll have to change
it to a text field type to avoid losing the trailing period.

Regards,
Steve
 
M

Miles

Steve,
Thanks for your reply. I have tried changing the xsd file so that the field
is a text field and that didn't solve the problem. It's almost as if the
infopath form sees the "1000." and figures that you don't need that last
period. The fact that "abc." works show me that it is using a text field.
Is there somewhere else besides the .xsd to set the textbox property as a
text field?

Thanks.
Miles
 
M

Miles

Fixed it.
The problem was the data type. However, you have to change the datatype in
the xsd and then delete and re-create the textbox. The textbox had some
strange behavior and remebered the previous datatype. I printed out the data
type and it said "string", but behaved like numeric (stripped trailing
period). By deleting and re-adding the textbox everything worked.

Miles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top