Problem form

Hello,
I test with a simple form to understand how it works.

Unfortunately unlike the other functions, it seems to me that this is not very well documented. There is a distinct lack of examples in this version 3 of htmlx.

Here to make a simple test I wish I had a message when the login field is empty :

{type:“input”, name: “name”, label:“Login”, validate: “NotEmpty”},

Unfortunately when I execute any messages, by field of red.

Finally it not work: (Can you enlighten me?

thank you,
Jacky

-----

Hello.

Form validation does not show messages, only red labels (also you can apply your custom style).

To show message you can use your custom validation rule, like this:

function myNotEmpty(val) { if (val.length == 0) { alert("Please enter your login."); return false; } return true; } function initForm() { var myForm = new dhtmlXForm("...", [ {type:"input", name: "name", label:"Login", validate: myNotEmpty} ]) }

hello,
Thank you for your quick response.

Have you an example of a complete html page that works only with red labels.

Because I have to be an error on my page, because nothing reacts: (

Thank you very much,
Jacky

I succeeded with this example:

by cons is it possible to have the field in red as on the dhtmlxform old version ?

thanks,
Jacky

Ok found it necessary to modify the css

and substitute:

.dhxlist_obj_dhx_skyblue .validate_error .dhxlist_txt_select {

    background-color:#FF6666;