1
How can I validate a zip code and fill in a field, for example the one in the city, using jquery validate?
For example: the field (input) that the user would fill the city would be "disabled" and the value of it would be picked up by a ZIP code validation, I found this free service that returns a JSON output on the CEP information.
validate the zip code is easy, it depends a little if it will have - or No, but basically it is 8 numbers so something like this already solves
/^\d{8}$/.test('01001000')
. Then you make a query in that service and use the return data to fill in the form. There is some specific point that ta having difficulty?– Neuber Oliveira
In fact, the validation would be if the CEP value "hit" with the return of JSON, and then fill in the fields, I’m using the Jquery Validate plugin.
– Thiago