Automatic filling of fields

Asked

Viewed 1,069 times

1

I’m developing a applying with Django (1.6.2) and Python 2.7 for learning, the application performs registration, searches and edits in DB, in one of the registrations I perform I would like to apply a function of automatic filling of other fields of the form, same as some sites where you type your CPF or ZIP code and the name and address fields are filled automatically when clicking outside the filled field.

Only in this case the fields would be filled according to the code (Primary key) of the items already registered in my Database.

How would it look for me to implement this function in my application?!

So far I have not used anything but Django, Python and Bootstrap for templates.

1 answer

1


You will need to use Jquery to implement this feature.

You are doing this on Django admin or in an off-admin application?

If you are in admin, take a look at this documentation

  • I’m doing outside the admin!

  • 1

    Then do it via Jquery/Ajax. For ZIP search a mail database or see about the google maps search API. For CPF, you will have to implement the search in your view.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.