简体   繁体   中英

form with a table that has rows dynamically created

I'm new to developments and I'm trying to develop a payroll system using node and express. I need your help to tackle the below situation.

In the "Add employee" form there is a table to track earnings of the employee. Table rows can be added dynamically when click an add new button. Similar input fields in the table carries the same name. Because of the same name of the similar fields jQuery validate option doesn't work and it doesn't stop submitting the form with blank fields.

Can anybody tell me is there a way to validate the fields with same name or to get similar fields with different names using req.body?

Use Class Name for same name fields to validate. And also use name as array otherwise only last data with same name will be posted after form submit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM