Hi all,
I am having a projectassign page,in that page i am having a dropdown box in which names of the projects are present.I am getting that project names from database. Below that list of users with checkbox are present.
So i can select a project from dropdown and check two users and click submit button,those two users will be assigned to that project.
Every this till this is fine.
Here is my question.Now when i select the same project from dropdown then it should show the two users as checked.and remaining users as unchecked. So anyone can help me please....

Member Avatar for rajarajan2017

Logic:

So every time you select from the combobox you should trigger a function to check with the database whether the project assigned for them. if yes make it select the boxes and disable all the check boxes.

If not, continue to submit the process

how to do it,can u please tell me....

Hey,
1. Add an onchange ajax function in the select box.
2. Take the select drop dwn value through ajax and pass it to the php url.
3. Write a select query to fetch the user id/name for the particular selected project and store it in an array.
4. Another query to fetch all the users
5. users will be listed with a checkbox with for loop
6.Now check inside the loop that whether the user id is present in the array if so, make the checkbox as checked.

so can u giv me some code relavent to that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.