4 Replies Latest reply: Feb 27, 2014 11:22 AM by Mike Tulak RSS

    Text validation

    Mike Tulak Community Member

      Is there a way of validating that text has been entered in a text box, I want to show hide this text feild, but show that text has been entered in the show hide buttons.

       

      Mike

        • 1. Re: Text validation
          George_Johnson CommunityMVP

          Yes, you can check whether a text field has any text in it with a script, but I don't understand what you mean by "...but show that text has been entered in the show hide buttons." Post again with more information if you'd like help with the script.

          • 2. Re: Text validation
            Mike Tulak Community Member

            Gearge my form is a complex audit risk form, it works very well, however the users complained that they dont have sticky notes to add reasons for reject etc. The form does not have room for a text area, so I used the show hide function to show and hide a text box which I can place anywhere over the form/page however when reviewing the completed form there is no way to know if a comment has been entered unless you open each comment show hide buttons, therefore if there is a way of checking if text has been entered like maybe something like this var length=mystring.length; with a return of background colour change or a text box with "text entry"

             

            Thanks for your reply

            Mike

            • 3. Re: Text validation
              George_Johnson CommunityMVP

              The code cold be something like this:

               

              if (getField("comment1").valueAsString) {

               

                  // The "comment1" field is not blank

               

              } else {

               

                  // The "comment1" field is blank

               

              }

              • 4. Re: Text validation
                Mike Tulak Community Member

                Thanks will try this out

                 

                Mike