kishor10d / Admin-Panel-User-Management-using-CodeIgniter

Admin Panel User Management Demo - CodeIgniter + AdminLTE Theme
http://cias.codeinsect.com
GNU General Public License v3.0
338 stars 241 forks source link

validation #4

Closed d33pak-s1ngh closed 7 years ago

d33pak-s1ngh commented 7 years ago

i have a read only field and i want to make it require where form can not be submitted if that field does not have a value. value comes dynamic and it can not be change thats why it is read only so can you tell me how i can validate it using your jquery validation. i use your jquery method like following where txtadd and txt range are readonly but require validation is not firing for those two. var validator = addDeviceForm.validate({ rules: { txtname: {required: true}, txtdesc: {required: true}, txtadd: {required: true}, txtrange: {required: true, digits: true} }, messages: { txtname: {required: "Fence name is required"}, txtdesc: {required: "Description is required"}, txtadd: {required: "Address is required"}, txtrange: {required: "Range is required", digits: "Only numbers allowed"}, } });

kishor10d commented 7 years ago

@d33pak-s1ngh : if those things are read-only and coming dynamically (means system is going to decide those values), So need to validate those values. Just submit those values using hidden fields.

d33pak-s1ngh commented 7 years ago

is there any way using which i can apply validation on read only text boxes? i cant use hidden fields values will come in textbox when user will select location on map and without selecting location it cant be submit. location will come base on map that's why it is read only where user can only change by selecting value from map