Comments (5)
Hey @chule143, did a quick search on this, looks like autocomplete in chrome is a common complaint without a solid fix at the moment. Relevant SO post.
As for the data not being displayed the second time, I'd need to see more code, specifically the part that opens the modal.
from angular-autofields-bootstrap.
Hi, sorry for the delay, this is the JS code, now is under construction, This is the way the data is managed:
app.controller('adminUsersCtrl', ['$scope', '$uibModal', 'Restangular', function($scope, $uibModal, Restangular) {
$scope.itemsByPage = 10;
$scope.users = [{ "id": "56ae9e80275543.92712665", "firstName": "test 1", "lastName": "ap1", "userName": "test", "email": "[email protected]", "phone": "", "country": "", "city": "", "address": "" }, { "id": "56ae9e893a9a22.47050190", "firstName": "super Admin", "lastName": "yo", "userName": "admin", "email": "[email protected]", "phone": "", "country": "AG", "city": "", "address": "" }, { "id": "56ae9eb6a65260.24141242", "firstName": "aaaa", "lastName": "aaa", "userName": "test111", "email": "[email protected]", "phone": "", "country": "AG", "city": "", "address": "" }];
$scope.displayedUsers = [].concat($scope.users);
function openModal(id) {
var modalInstance = $uibModal.open({
animation: true,
templateUrl: 'partials/admin/users-modal.htm',
controller: 'adminUsersModalCtrl',
size: 'lg',
resolve: {
params: function() {
return {
id: (id) ? id : false
};
}
}
});
};
$scope.addRecord = function() {
openModal();
};
$scope.editRecord = function(id) {
openModal(id);
};
getData();
}]).controller('adminUsersModalCtrl', ['$scope', '$uibModalInstance', 'params', 'Restangular', function($scope, $uibModalInstance, params, Restangular) {
if (params.id) {
Restangular.one('data', params.id).get({
filter: {
table: 'users'
}
}).then(function(resp) {
$scope.formModel = resp;
});
} else {
var form = Restangular.all('users');
$scope.formModel = {
firstName: '',
lastName: '',
userName: '',
password: '',
address: '',
};
};
$scope.schema = [{
type: 'multiple',
fields: [{
property: 'firstName',
label: 'First Name',
type: 'text',
columns: 6
}, {
property: 'lastName',
label: 'Last Name',
type: 'text',
columns: 6
}]
}, {
type: 'multiple',
fields: [{
property: 'userName',
label: 'User Name',
type: 'text',
columns: 6
}, {
property: 'password',
label: 'Password',
type: 'password',
columns: 6
}]
}, {
property: 'address',
label: 'Address',
type: 'textarea'
}];
$scope.options = {
validation: {
enabled: true,
showMessages: false
},
layout: {
type: 'basic',
labelSize: 3,
inputSize: 9
}
};
$scope.saveUser = function() {
if (params.id) {
$scope.formModel.put({
table: 'users'
}).then(function(resp) {
$uibModalInstance.close();
// alert('Updated');
});
} else {
form.post($scope.formModel, {
table: 'users'
}).then(function(resp) {
$uibModalInstance.close();
});
};
};
$scope.close = function() {
$uibModalInstance.dismiss('cancel');
};
}])
Ps. It's really useful your library :)
from angular-autofields-bootstrap.
I found this article: https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
This is the code with autofields:
{
type: 'multiple',
fields: [{
property: 'userName',
label: 'User Name',
type: 'text',
columns: 6,
attr: {
autocomplete: 'nope'
}
}, {
property: 'password',
label: 'Password',
type: 'password',
columns: 6,
attr: {
autocomplete: 'nope'
}
}]
}
And works like this:
The first time runs correctly and the second one is autofilled with the chrome autofill option
This is the code with html directly:
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="username">User Name</label>
<input ng-model="formModel.userName" type="text" class="form-control" id="username" placeholder="User Name" autocomplete="nope">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="password">Password</label>
<input ng-model="formModel.password" type="password" class="form-control" id="password" placeholder="Password" autocomplete="nope">
</div>
</div>
</div>
and works normally all the time:
from angular-autofields-bootstrap.
Not sure if I'm seeing it correctly, but it looks like the autocomplete:
nope works correctly the first time but not the second?
On Sun, Apr 3, 2016 at 10:49 AM, Abel [email protected] wrote:
I found this article:
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletionThis is the code with autofields:
{
type: 'multiple',
fields: [{
property: 'userName',
label: 'User Name',
type: 'text',
columns: 6,
attr: {
autocomplete: 'nope'
}
}, {
property: 'password',
label: 'Password',
type: 'password',
columns: 6,
attr: {
autocomplete: 'nope'
}
}]
}And works like this:
[image: autofields]
https://cloud.githubusercontent.com/assets/1250071/14233862/55edcb7c-f9a2-11e5-9253-24eced430dcc.gif
The first time runs correctly and the second one is autofilled with the
chrome autofill optionThis is the code with html directly:
User Name</div> <div class="col-md-6"> <div class="form-group"> <label for="password">Password</label> <input ng-model="formModel.password" type="password" class="form-control" id="password" placeholder="Password" autocomplete="nope"> </div> </div> </div>
and works normally all the time:
[image: html]
https://cloud.githubusercontent.com/assets/1250071/14233867/78a9762a-f9a2-11e5-885a-2aeabaf5f499.gif—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#46 (comment)
from angular-autofields-bootstrap.
Hi, I have solved this by putting before auto:fields .... tag:
<input type="password" style="width: 0;height: 0; visibility: hidden;position:absolute;left:0;top:0;"/>
found digging internet somewhere.
from angular-autofields-bootstrap.
Related Issues (20)
- Custom Validation HOT 2
- How to set focus on first text box ? HOT 2
- Add multiple select boxes HOT 2
- Datepicker compatibility HOT 1
- Any plan to implement this lib using angular2 HOT 1
- Grouping and Groupheaders HOT 1
- 'multiple' type field HOT 1
- CSS classes HOT 2
- Date Options - ng-model-options timezone HOT 2
- Odd mobile behaviour on dropdown boxes. HOT 3
- Custom attributes option not working HOT 2
- Integration with chosen HOT 3
- Unsupported pseudo: fields
- Tooltips are not placed correctly HOT 1
- Use `xs` instead of `sm` columns. HOT 2
- Create custom field select and ng-selected HOT 1
- How to include ng click event to a field HOT 1
- setAttributes should be exposed for overriding on the autofields object HOT 5
- bower.json has been removed, breaking grunt builds HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-autofields-bootstrap.