Interest Phenomenon with Rich Text Validation - InfoPath Dev
in

InfoPath Dev

Interest Phenomenon with Rich Text Validation

Last post 04-22-2010 11:15 AM by sonisick. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-22-2010 11:09 AM

    Interest Phenomenon with Rich Text Validation

    Had an error on a Rich Text box in that it did not show a validation error when text was entered then removed.

    I had various form validations: not blank, regular expression, expression string-length---did work.

    Since I was using managed code anyway--I put code in error routine that still didn't work

    try
                    {
                        string strFullMessage = xn.SelectSingleNode("/my:myFields/my:InitializedVariables/my:FullMessage", NamespaceManager).Value;


                        if (strFullMessage.Length == 0)
                                    {
                            _errorString += "FullMessage" + ": " + "must contain a value";
                            if (errcnt == 0)
                            {
                                txtErrmsg_01.SetValue("FullMessage" + ": " + "must contain a value");
                            }
                            else
                            {
                                txtErrmsg_02.SetValue("FullMessage" + ": " + "must contain a value");
                            }

                            errcnt++;
                        }
                    }
                    catch (Exception ex)
                    {
                        if (errcnt == 0)
                        {
                            txtErrmsg_01.SetValue("FullMessage" + ": " + ex.Message.ToString());
                        }
                        else
                        {
                            txtErrmsg_02.SetValue("FullMessage" + ": " + ex.Message.ToString());
                        }


                    }

     

    Finally I decided to display the string length on the form at various states in an optional debug session I use: string-length(Full-Message)

    Turns out that once data is put into the Rich-Textbox and subsequently removed it has a length of 1 NOT 0.

    I changed the above code to if (strFullMessage ==1) and I began to detect a blank Rich Text box.

     

     

  • 04-22-2010 11:15 AM In reply to

    Re: Interest Phenomenon with Rich Text Validation

    OOps Second line should say:

    I had various form validations: not blank, regular expression, expression string-length---DIDN'T work.

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