I want to send the username and password values which user types in html input elements to server to check if the username and password is valid or not when user click login button, using post request in $.ajax(options) method in jquery.
But I don’t know how to send the username and password to server. What option should I write in the $.ajax(options) method to get those values from server?
You can do like:
In the server file, you check the record of user in your db if it exists, you simply send back some response like
1for success and0for failure and use that in thesuccessarguments of the$.ajaxfunction to take the appropriate action.