Hi guys,
I made a video on how to solve this problem.
here is the Link

https://youtu.be/XvX6Q64oFyw

On Wed, Jun 10, 2020 at 3:50 PM chaitanya orakala <chaitu.orak...@gmail.com>
wrote:

> Answer :
>
> *First hide the necessary fields which you want  to hide and pop in drop
> down.*
> style.css
> ****
> #id_exec_first_name, label[for="id_exec_first_name"] {
>   display: none
> }
>
> #id_exec_last_name, label[for="id_exec_last_name"]{
> display: none
> }
>
> #id_exec_title, label[for="id_exec_title"]{
> display: none
> }
>
> #id_exec_email, label[for="id_exec_email"]{
> display: none
> }
>
> #id_exec_phone_number, label[for="id_exec_phone_number"]{
> display: none
> }
>
> #id_exec_fax, label[for="id_exec_fax"]{
> display: none
> }
>
> #li{
> list-style: none;
> }
> ****
>
>
> *Include jquery CDN and write a function to make fields display which is
> hidden, grad id fields from inspect element.*
> *Html*
> *****
> {% extends 'er_form/index.html' %}
>
>
>
> {% block content %}
>
>
> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js";
> integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
> crossorigin="anonymous"></script>
>
> <script>
> $(function () {
>
>  $('#id_executive_authority_1').on('click', function () {
>  $('#id_exec_first_name, label[for="id_exec_first_name"]').show();
>  $('#id_exec_last_name, label[for="id_exec_last_name"]').show();
>  $('#id_exec_title, label[for="id_exec_title"]').show();
>  $('#id_exec_email, label[for="id_exec_email"]').show();
>  $('#id_exec_phone_number, label[for="id_exec_phone_number"]').show();
>  $('#id_exec_fax, label[for="id_exec_fax"]').show();
>
> });
> });
>
>
> $(function () {
>
>  $('#id_executive_authority_0').on('click', function () {
>  $('#id_exec_first_name, label[for="id_exec_first_name"]').hide();
>  $('#id_exec_last_name, label[for="id_exec_last_name"]').hide();
>  $('#id_exec_title, label[for="id_exec_title"]').hide();
>  $('#id_exec_email, label[for="id_exec_email"]').hide();
>  $('#id_exec_phone_number, label[for="id_exec_phone_number"]').hide();
>  $('#id_exec_fax, label[for="id_exec_fax"]').hide();
>
> });
> });
>
>
> </script>
>
>  <div class="container">
>     <div class="form-group">
>             <form method="POST">
>             {% csrf_token %}
>             {{ client_form.as_p }}
>             {{ billing_form.as_p }}
>             <button type="submit" class="btn btn-primary">Submit</button>
>             </form>
>     </div>
>   </div>
> {% endblock content %}
>
>>
>> *****
>
>
>
> On Wed, Jun 10, 2020 at 6:00 AM Balaji Shetty <balajishe...@gmail.com>
> wrote:
>
>> Thank You Very Much for considering advice
>>
>> On Wed, Jun 10, 2020 at 8:11 AM chaitanya orakala <
>> chaitu.orak...@gmail.com> wrote:
>>
>>> sure, I will do it by tomorrow
>>>
>>>
>>> On Tue, Jun 9, 2020 at 2:35 AM Balaji Shetty <balajishe...@gmail.com>
>>> wrote:
>>>
>>>> Nice
>>>>
>>>> Can you please share sample code on git link.
>>>>
>>>> This is very common requirement in every project
>>>>
>>>>
>>>>
>>>> On Tuesday, June 9, 2020, chaitanya orakala <chaitu.orak...@gmail.com>
>>>> wrote:
>>>>
>>>>> Thank You, Amine Aziz. I tried jquery and it worked. its so simple
>>>>> once we know jquery.
>>>>> do help others like you did to me.
>>>>>
>>>>> On Sun, Jun 7, 2020 at 1:18 PM AMINE AZIZ <a.amine...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> I will share with you my iwn code used in admin , but it still the
>>>>>> same as the front end
>>>>>>
>>>>>> withe jQuery i can show input or hide it , so you will do the same
>>>>>> with popup , by default it will be display none, and with Jquery you can
>>>>>> show it if user change value to yes dropdown (select)
>>>>>>
>>>>>> you will use id div of pupup to show it or hide it
>>>>>>
>>>>>>
>>>>>> if (!$) {
>>>>>>     // Need this line because Django also provided jQuery and namespaced 
>>>>>> as django.jQuery
>>>>>>     $ = django.jQuery;
>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>> $(document).ready(function() {
>>>>>>
>>>>>>     $("#id_paysPartenaires").change(function()
>>>>>>     {
>>>>>>
>>>>>>
>>>>>>
>>>>>>                      var 
>>>>>> total_partenaire=$("#id_multipartenairecooperationbilaterale_set-TOTAL_FORMS").val()
>>>>>>                                 var SelectNumber =  i
>>>>>>                                  
>>>>>> SelectedValuePartenaire=$("#id_multipartenairecooperationbilaterale_set-"+SelectNumber+"-multiPartenairePP").val()
>>>>>>                                  //alert(SelectNumber)
>>>>>>
>>>>>>
>>>>>>
>>>>>>                             
>>>>>> $("[id=div-2-multiAdefinir]:eq("+SelectNumber+")").hide();
>>>>>>                             
>>>>>> $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();
>>>>>>                            
>>>>>> $("[id=div-2-multiGouvernementPP]:eq("+SelectNumber+")").hide();
>>>>>>                             
>>>>>> $("[id=div-2-multiPaysPP]:eq("+SelectNumber+")").show();
>>>>>>                   }
>>>>>>
>>>>>>
>>>>>> });
>>>>>>
>>>>>>
>>>>>> Le dimanche 7 juin 2020 07:34:00 UTC+1, Sai a écrit :
>>>>>>>
>>>>>>> Hi guys,
>>>>>>> I am working on a* Django project,* which involves submission form
>>>>>>> and saving the data in the database using model form.  I am stuck with 
>>>>>>> one
>>>>>>> of the functionalities of form which should work like for example "do 
>>>>>>> you
>>>>>>> want benefit plan: *YES,* *next Field options should pop up*. if
>>>>>>> click* NO, nothing should happen* and move to the next question."
>>>>>>>
>>>>>>> I went through all over the internet and found the dependent
>>>>>>> drop-down select option but not like field pop up as we click through te
>>>>>>> form.
>>>>>>>
>>>>>>> Please let me know how to achieve this in a clear way as I am new to
>>>>>>> Django and programming as well.
>>>>>>>
>>>>>>> Thank You so much in advance.....
>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to django-users+unsubscr...@googlegroups.com.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/django-users/3f3bf262-7fac-4818-836e-dc8532dae707o%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/django-users/3f3bf262-7fac-4818-836e-dc8532dae707o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/CAPcTzRabB90jUEuYj1v-9JWdOMqqsM4fjN-TEq1CwOcwEPX1zA%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAPcTzRabB90jUEuYj1v-9JWdOMqqsM4fjN-TEq1CwOcwEPX1zA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> --
>>>> Mr Shetty Balaji
>>>> Asst. Prof.
>>>> IT Department
>>>> SGGS I&T
>>>> Nanded. My. India
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CAECSbOt4OiS_WLAucNWQtwpWuZ_LZe1hXyM4%3DFXZzmm6mSVGHw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAECSbOt4OiS_WLAucNWQtwpWuZ_LZe1hXyM4%3DFXZzmm6mSVGHw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPcTzRZb4y8yGrf%3DM%3DX4cEhGaf_TWmMnszknWd13Zen_uxfMHw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAPcTzRZb4y8yGrf%3DM%3DX4cEhGaf_TWmMnszknWd13Zen_uxfMHw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>>
>>
>> *Mr. Shetty Balaji S.Asst. ProfessorDepartment of Information Technology,*
>> *SGGS Institute of Engineering & Technology, Vishnupuri, Nanded.MH.India*
>> *Official: bsshe...@sggs.ac.in <bsshe...@sggs.ac.in> *
>> *  Mobile: +91-7276300495*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAECSbOvdwbQPHzfMAPA7ubj9waAC6vx6ReqsLPuTgzHgLO9d0g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAECSbOvdwbQPHzfMAPA7ubj9waAC6vx6ReqsLPuTgzHgLO9d0g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPcTzRZzyquxevpxfnYCare0jc0S5rVqVwU%3Dam1F26CtbvxHgw%40mail.gmail.com.

Reply via email to