NSB.Validation is not displayed

Hello, I am trying to use the validation functionality, but I am having some issues:

  1. I checked the Validation checkbox on the Project Explorer; however when I type “NSB.” the validation option is not displayed. Why is this?
  2. Obviously, when I execute the application I got the following error:

Uncaught TypeError: Cannot read property ‘element’ of undefined.
line 133 column 23

Which I asume this is because the “lack” of validation option on the NSB row.

Can you give me a light on this?

Best Regards,
Adrian

Are you using a control? Which one?

Hi George, let me put additional details.

  1. I setup the library of Validation (Img 1)

  2. I am using a container from the Common Section and input fields from Bootstrap4 (Img 2)

  3. The code that I am following is as follows:

Function Login_onshow()
    InitLGValidation()
End Function
Function InitLGValidation()
  Dim validateRules = { rules: {TxtLGEmail: { required: True, Email: True }, _
                                TxtLGPassword: "required", _
                                }, _
                        messages: {TxtLGEmail: "Se necesita un correo electrónico válido.", _
                                   TxtLGPassword: "Introduce la contraseña"}, _
                      }

  NSB.validation(CtLogin, validateRules)  
End Function


Function BtnLGLogin_onclick()
  $("#CtLogin").valid()
End Function
  1. As I mention on my initial message, with all this setup, does not display the validation option in the NSB call. (Img 3)

  2. Finally the error message that I receive when I execute the app (forcing the NSB.validation) when I do the click on the login button is the following (Img 4)

Are there any messages in the Chrome Console?

If you click on the error message in the Chrome Console, what line of code does it point to?

Hi George, sorry for the delay, here are the debug screens

Is the Validation sample working OK for you?

Hi George, Yes, the example is working fine, which I would say it is more frustrating =P

Best Regards,
Adrian

Finally I found the solution. The problem was in the container. By default, when you generate a container, the HTMLTag property (which by the way I do not know which is the purpose of it) comes with a “div” value by default.

In order to make this work, you need to change the value to “form”. I think it would be a good idea to include this detail in the wiki documentation for the validation functionality.

Good catch. While the docs do say you need to use a form, wording was added to make it more explicit.