javascript - Knockout: filling observable with an email produces [object HTMLinput] output -
javascript - Knockout: filling observable with an email produces [object HTMLinput] output -
i have string "admin@admin.ru"
take out of cookies.
i have model
var loginmodel = function () { this.authemail = ko.observable(""); this.authpassword = ko.observable(""); }; var ajaxloginmodel = new loginmodel();
i do
ajaxloginmodel.authemail("admin@admin.ru");
it works fine, in input element in looks
html:
<form class="form-horizontal" id="form-ajaxlogin"> <fieldset> <h4 align="center">Пожалуйста, авторизуйтесь.</h4> <div class="control-group" align="center"> <label class="control-label control-label-120" for="authemail">e-mail</label> <div class="controls"> <input type="text" name="authemail" class="input-xlarge required email" id="authemail" data-bind="value: authemail, valueupdate: 'afterkeydown'"/> </div> </div> <div class="control-group" align="center"> <label class="control-label control-label-120" for="authpassword">Пароль</label> <div class="controls"> <input type="password" name="authpassword" class="input-xlarge" id="authpassword" data-bind="value: authpassword, valueupdate: 'afterkeydown'"/> </div> </div> </fieldset> </form>
full screenshot: http://i.gyazo.com/473b9d9a80113dee5fdcd80d8adacd50.png
i ran similar 1 time upon time, , although cannot remember specifics, issue may resolved changing or removing id
or name
attributes of authemail input element (i cannot remember which). alternatively may alter name of observable other authemail.
javascript forms knockout.js
Comments
Post a Comment