jeudi 30 avril 2015

Webix form get value

I'm using the JS libray Webix to build a front-end for an application. For login, I'm using their form. http://ift.tt/1GAwoLM

I'm having an issue using getValues() where it returns an undefined. I'll post my exact code.

Any help is appreciated.

<script>
            webix.ready(function(){
                webix.ui({
                    view:"form", 
                    id:'log_form',
                    width:300,
                    elements:[
                    { view:"text", id:"user", label:"Username"},
                    { view:"text", type:"password", label:"Password"},
                    { margin:5, cols:[
                        { view:"button", click:"testLogin", value:"Login"}
                    ]}
                    ]
                });

            });

            function testLogin()
            {
                var suppliedUser = $$('log_form').getValues().user;
                var suppliedPass = $$('log_form').getValues().password;
                console.log(suppliedUser);
                console.log(suppliedPass);
            }
        </script>




Aucun commentaire:

Enregistrer un commentaire