Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LoginControl.prototype = {
- loginInitialize: function(placeHolder, name) {
- var currentInstance = this;
- var view = currentInstance.loginUI;
- currentInstance.name = name;
- view.children('.login-form').submit(function(event) {
- if(currentInstance.loginData.username === '' || currentInstance.loginData.password === '') {
- alert (currentInstance.name + ': Input fields should not be empty');
- } else {
- LoginAdapter.login(currentInstance);
- }
- event.preventDefault();
- });
- view.find('input[name=username]').change( function() {
- currentInstance.loginData.username = $(this).val();
- });
- view.find('input[name=password]').change( function() {
- currentInstance.loginData.password = $(this).val();
- });
- placeHolder.append(view);
- }
- };
Add Comment
Please, Sign In to add comment