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.

Reply via email to