0

I'm trying to update a user status to either enabled or disabled in the user database. I already have my toggle in place. When I view the user table from the dashboard, I want to be able to see the toggle button according to their status. I also want to be able to update their status using the same toggle.

I know it can be done with AJAX but I'm not sure about the implementation.

Anyone kind enough to enlighten me?

1
  • In your route and controller declare and manipulate code as you would on a normal form POST and then run your AJAX. stackoverflow.com/questions/41981922/… Commented Dec 9, 2018 at 11:10

1 Answer 1

0

You are right! You should implement it with ajax. Firstly create a route and controller method for accessing/controlling data. Then, implement ajax call. You can use axios library for this,too. It is a very powerful library. After you send ajax call and take the response, You should manipulate DOM according to ajax response. It is a generic question and generic answer :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.