October 31, 201411 yr I'm trying to have a field format its content as all caps and assign the font / size as I indicate in the Inspector panel. I also need to remove all non-alphanumeric characters from the input. Generally speaking it works ok other than despite "Synchronized with field's font" being selected for the field, input pasted from a pdf string for instance retains its source formatting (or at least does not apply field's formatting). I though of maybe stripping the formatting through calculation rather than to rely on Inspector settings. ...I get weird results though, input appears twice in the field. Clearly I messed something up in this function.... any help? TextFormatRemove ( Self ) & Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" )
October 31, 201411 yr input appears twice in the field. TextFormatRemove ( Self ) & Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ) That's because you are calculating the input twice, then concatenating the results with the '&' operator. Instead, you need to apply the second function to the result of the first one: TextFormatRemove ( Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ) ) or (formatted differently) TextFormatRemove ( Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ) ) or (using Let() to calculate an intermediate result) Let ( res = Filter ( Self ; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ) ; TextFormatRemove ( res ) )
Create an account or sign in to comment