View Full Version : Message for empty form items

27 Mar 2012, 4:06 AM
I have a form and I want to show a alert message if a user want to save or update an empty form items. I tried to access all the items and push them into an array and checked if any of them is null or undefined. But it is giving me errors when I delete the items because the null value of that deleted items still exists in the array. And I don't know how to specifically remove it coz it's position is not specific. Is there any better way to resolve this problem?

for (var k = 0; k < this.Array.length; k++) {
var fieldValue = this.Array[k];
for (var i = 0; i < fieldValue.length; i++) {

if (fieldValue[i].value === ' ' || fieldValue[i].value === null || fieldValue[i].value === 'undefined') {
Ext.Msg.alert('Please enter the require fields');


27 Mar 2012, 10:41 AM
When you do a check you may want to set this.Array as an empty array.