Check for Ampersand in Field name - InfoPath Dev
in

InfoPath Dev

Check for Ampersand in Field name

Last post 07-18-2006 09:32 AM by Matt Faus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-17-2006 07:20 AM

    Check for Ampersand in Field name

    I would like to use the data from a field as a column in my SharePoint library and to make this work, the field must not contain an Ampersand (&) symbol. What is the best way to ensure that users don't include special characters in a field?
    Dean
    Charlotte, NC
  • 07-17-2006 07:36 AM In reply to

    Re: Check for Ampersand in Field name

    You could use some code to get rid of the & character if someone enterd it to you textbox.
    For example in an OnAfterChange event write the text from your textbox into a string and use the string.Replace() method and replace all & through and empty string or something.

    Hope it helps
    Listen to Motörhead cos they play Rock'n Roll :)
  • 07-17-2006 08:09 AM In reply to

    Re: Check for Ampersand in Field name

    An additional complication that I failed to include initially, is that the users have the option of retrieving the data from a secondary data connection that could contain an ampersand, and what I really need to be able to do is convert the & symbol to "and" while executing the Rule that I am using to fill in the field from the secondary data source.
    Dean
    Charlotte, NC
  • 07-18-2006 09:32 AM In reply to

    Re: Check for Ampersand in Field name

    I used this formula to get rid of one of the &s, maybe you could cook up something with eval() to do it recursively?

    concat(substring-before(field4, "&"), "and", substring-after(field4, "&"))
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.