Hi
$('#locationFormId').bootstrapValidator({
container: '#messages',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
Id: {
validators: {
notEmpty: {
message: 'Id is required and cannot be empty'
}
},
stringLength: {
max: 4,
message: 'Id must not be more than 4 characters long'
},
regexp: {
regexp: /^[a-zA-Z\.]+$/,
message: 'Id can only consist of alphabets.'
}
},
Description: {
validators: {
notEmpty: {
message: 'Description is required and cannot be empty'
}
},
stringLength: {
max: 25,
message: 'Description must not be more than 25 characters long'
},
regexp: {
regexp: /^[a-zA-Z\.]+$/,
message: 'Description can only consist of alphabets.'
}
}
}
});
*******************************************************************************************
@using (Html.BeginForm("CreateEdit", "Location", FormMethod.Post,new { @id = "locationFormId", @class = "form-horizontal", role = "form" }))
{
}
Thanks

Sachin SinghRank #66 · 26.2K reputationPosted Jun 13, 2021, 1:12 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Jun 14, 2021, 12:52 AM EDT
Ramco RamcoRank #462 · 5.4K reputationPosted Jun 14, 2021, 1:15 AM EDT
Hi Sachin
Now nothing is working
fields: {
txtId: {
validators: {
notEmpty: {
message: 'Id is required and cannot be empty'
}
},
stringLength: {
max: 4,
message: 'Id must not be more than 4 characters long'
},
regexp: {
regexp: /^[a-zA-Z\.]+$/,
message: 'Id can only consist of alphabets.'
}
},
txtDescription: {
validators: {
notEmpty: {
message: 'Description is required and cannot be empty'
}
},
stringLength: {
max: 25,
message: 'Description must not be more than 25 characters long'
},
regexp: {
regexp: /^[a-zA-Z\.]+$/,
message: 'Description can only consist of alphabets.'
}
}
}
Thanks
Sachin SinghRank #66 · 26.2K reputationPosted Jun 14, 2021, 1:26 AM EDT
Ramco RamcoRank #462 · 5.4K reputationPosted Jun 14, 2021, 1:37 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Jun 14, 2021, 2:08 AM EDT
Ramco RamcoRank #462 · 5.4K reputationPosted Jun 14, 2021, 2:12 AM EDT