I’m working on a web project which has lots of tables. Do I need to write a separate function for each of the cells in the table for validation? Can I some how reduce the code?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No you can’t use the same id for two elements. What you can do is just pass the id of the element as argument in the function you want to call to call on that element and save it as variable in your function.
See this code which I have written for you
By
this.idyou can send the id to the function. So no need of same ID.