I have a form page where users enter some data and upon hitting ‘submit’ a query is executed in our database that pulls up relevant information.
So, users put in two things into the form: class name and time.
after that, our php file pulls up a table with section information.
for example: ENG 212 has two sections: ENG212-001 and ENG212-101. So, in the table, it has information about the section like max enrollment and location, etc. it also shows how many people are currently enrolled in that section.
Now I want users to select a section. if the max enrollment is 10 and currently enrolled are 10 students, then the user can’t select that. if currently enrolled is < max enrollment, then the user can select that section.
so, HTML page with form –> php file that pulls up the table —> now i need a way for user to select one of the sections, but if they are full I want them not to be able to even select it.
I’m thinking of doing radio buttons but I have no idea how I’d implement them for this particular scenario
how do i implement this? i’ve tried looking online and I have no idea how to implement this.
any help would be appreciated.
After you submit the HTML Form and you get the max enrollment value check it in PHP and print the radio buttons from within PHP based on the value you got.