lucavandro / CodiceFiscaleJS

CodiceFiscale.js is a utility library to compute and validate Italian Tax code (codice fiscale).
Creative Commons Attribution Share Alike 4.0 International
197 stars 77 forks source link

birthplace name or code #52

Closed laerte8 closed 3 years ago

laerte8 commented 3 years ago

hello, I have a question about the birthplace. in page the option elements are like this:

I used CodiceFiscale.utils.birthplaceFields("#birthplace_province", "#birthplace"); to build the select the value is A010, so, if I use e.target.value it returns A010.

but if i create a new CodiceFiscaleJS({...data,birthdate:A010}) it returns an error because it expects Abbiategrasso as value.

how can I get the birthplace name and not the code? thanks

lucavandro commented 3 years ago

Hi! The problem is this new CodiceFiscaleJS({...data,birthdate:A010} you should use **birthplace** in that place. new CodiceFiscaleJS({...data,birthplace:A010})`

I hope this could help