java script to add more fields in the for, such as add sub type