Python Dynamically Add Attribute Using Javascript To Validate