jquery - Populating the hidden field in Javascript -
I'm using Knockback.js. I'm a newbie for this whole JavaScript and HTML. I'm trying to populate the hidden fields in the addFolder function, but it's always showing blank. This is the following JavaScript code (View MODEL).
groupsView = LS.ViewModel.extend ({initialize: function (option) {if (optionsof options! = 'Undefined') {this.projectskey = Options.projectskey; this.folderkey = options .folderkey;} this.options = option; this._this = this; this.c = new group option (empty, option); this.c.fetch ({add: true}); this.groups = kb.collectionObservable (this .c);}, Fetch: function () {$ ('# loadingAnim') Show (); this.groups.collection (). Fetch ({update: true, add: true});}, addFolder: function (VM, Event) {event.preventDefault (); $ ("# plgGroupsGetContents") Val (vm.projectskey); $ ("# plgGroupsGetContents1"). Val (vm.folderkey)); Vm.c.addFolder (); $ ('# DialogEdfolders') Model ('hide');}
});
And this is the following HTML code
& lt; Form action = "/ groups / createfolder" id = "addFoldersForm" data-bind = "event: {submit: $ root.addFolder.bind ()}" & gt; & Lt; Div class = "modal-dialog" & gt; & Lt; Div class = "modal-content" & gt; & Lt; Div class = "modal-header" & gt; & Lt; Button type = "button" class = "off" data-rejected = "modal" Aria-hidden = "true" & gt; And;; & Lt; / Button & gt; & Lt; H4 class = "modal-title" id = "myModalLabel" data-bound = "text: LANG.getText ('plgGroupAddFolder')" & gt; & Lt; / H4 & gt; & Lt; / Div & gt; & Lt; Div class = "modal-body" & gt; & Lt; Input type = "hidden" name = "projectcany" id = "plgGroupsGetContents" value = "" & gt; & Lt; Input type = "hidden" name = "rootfolder" id = "plgGroupsGetContents1" value = "" & gt; & Lt; Span data-bound = "text: LANG.getText ('plgGroupFolderName')" /> & Lt; Input type = "text" data-bind = "atri: {placeholder: LANG.getText ('plgNameDefaultText')}" expected title = "folder name" name = "folder name" data-mark = "u" & gt; ; & Lt; Br> & Lt; / Div & gt; & Lt; Div class = "modal-footer" & gt; & Lt; Button Data-Bind = "Text: LANG.getText ('plgGroupAbort')" Type = "button" class = "BTN BTN-default" Data-Dismiss = "Model" & gt; & Lt; / Button & gt; & Lt; Button Data-Bind = "Text: LANG.getText ('plgGroupAddFolderOKBtn')" class = "BTN BTN-Primary" & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - /.modal-content - & gt; & Lt; / Div & gt; & Lt ;! - /.modal-dialog - & gt;
Would you please suggest some suggestions to me in advance thank you
Comments
Post a Comment