You might have noticed that sometimes websites like e-commerce or some government website have two address fields in their forms.One for primary address and another for secondary address(or one for billing address and another for shipping address etc).
Most of the time people have same primary and secondary addresses and to save us from the tedious work of re-entering same data again they have some kind of option to automatically copy the contents of one fields into another.
In the form we are going to discuss, there is a checkbox and whenever it is checked, the code automatically copies values from primary address and primary zip-code to the secondary address and secondary zip-code respectively.If the checkbox is unchecked, these fields will go blank.
Here is the simple code for such kind of form:
That’s it I hope you like it please comment your feedback.