Is it possible to retain spaces at the beginning of a field? - InfoPath Dev
in

InfoPath Dev

Is it possible to retain spaces at the beginning of a field?

Last post 11-18-2009 07:42 AM by Samuel Hagaman. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-17-2009 05:47 AM

    Is it possible to retain spaces at the beginning of a field?

    Does anyone know if it's possible to retain spaces at the beginning of a field?  I am trying to submit a field to a web service as a parameter but the field needs to be in the format of a space followed by a two digit number (i.e. - " 41").  This is necessary because that's the way the data is stored in the SQL database and if at all possible I don't want to write a web service that concats a space and the two digits and then submits that as the parameter.  In InfoPath if I set a field to " 41" the space is automatically removed and I am left with only "41".  I know that in Excel you are able to keep the spaces in a cell by formatting the cell as text or entering an apostrophe in front of the string but this doesn't seem to work in InfoPath.

     

    Thanks in advance for any help,

    Sam
  • 11-17-2009 07:04 AM In reply to

    Re: Is it possible to retain spaces at the beginning of a field?

    Are you sure that the space is actually being removed?  If I type a value with spaces at the beginning in an InfoPath field and submit it to a web service, the spaces at the beginning of the value disappear in the form's text box, but they are still transmitted to the web service.

     If you have verified that the spaces actually are being stripped away, you could try using a rule in the form to append spaces at the beginning [concat(' ', /my:myFields/my:field), or something like that.  This would probably be a good practice anyway, as it doesn't require the user to enter the space into the form manually.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-18-2009 07:42 AM In reply to

    Re: Is it possible to retain spaces at the beginning of a field?

    You are correct!  The spaces are there even though they aren't displayed in the field's text box.  When i finally tracked it down the problem with the web service actually had to do with a security logon issue to the SQL database. 

    Thanks for the help! :)

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