django - How to populate a form field based on the choice done on a previous form field -


models.py

title_choices=(('software engineer trainee',"software engineer trainee"), ('senior software engineer ',"senior software engineer")) op_title = models.charfield(max_length=768, blank=true,choices=title_choices,default="software engineer trainee") op_skill_required = models.charfield(max_length=3072, blank=true) op_skill_preferred = models.charfield(max_length=3072, blank=true) 

im using form.as_table render form in order display in web page. when click on 1 of title_choices, based on choice want populate skill_preferred , skill_required field of form... der way it???

you need client side solution this; 1 can query server information when user selects choice.

since common task, there numerous third-party modules available this. django-ajax-selects 1 of them, , dajax project provides such integrations django.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -