Hi Everyone, I am trying to build dynamic page registration.
this is the user story:
1)user put his name
2) user put is email
4) user pick Main Class
5) user picks 3 submain class.
I am trying to make the 4) to be dynamic,
when someone picks the main class from a list of buttons
(i use jquery to change the select field(char field with choices), it will filter the submain objecst with only objects related to that main class.
here is my view:
def home(request): form=StudentForm(request.POST or None) mains= Speciality.objects.all() #the main class subs=Submain.objects.all() #the sub class if form.is_valid(): form.save() context={'form':form,'mains':mains,"subs":subs} return render(request,"formmate/main.html",context)
so I just want the “subs” to change without refreshing the web or load other pages.
Last Example:
Name:Snir
Email:snirben@…
Main Class: (alot of buttons with names)>>> jquery will change the list, list is “display:none”.
subclass: alot of buttons with subclass with no filter related to the main class.
in my html page, i have a for loop of subs.
so how can i make the context to change ?
could not find ajax or jquery similer problem.
thank you!