Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Constructing a custom login form using ajax

Thanks to @eskimo I was able to get this working and figured I share an answer for any of those trying to do the same!

In the ajax-login-script.js file all I had to do was change this $('form#login_form').on('#submit', function(e) to this … $('form#login_form').on('submit', function(e) just removing the # before calling submit.

Hope this helps someone!

Related Posts:

  1. Adding “Remember Me” in custom login
  2. How build a custom login/register form with error handling?
  3. Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
  4. User registration followed by automatic login
  5. Can I use the same nonce for multiple requests on the same page?
  6. How can I fetch loop of post titles via AJAX?
  7. How to change the wp-login.php page title?
  8. Retrieve POST data from AJAX call
  9. username_exists() function can’t be access without logging in
  10. The correct method to pass query vars in AJAX using ajaxurl
  11. Using wp_send_json to return HTML
  12. WordPress AJAX Pagination with query_posts
  13. Is having multiple theme customizers for different pages possible?
  14. Do I require the use of nonce?
  15. How to check if new posts have been published since page load?
  16. WordPress Ajax always returns a 404 error
  17. Where to include php files in wordpress and how to refer to them later [closed]
  18. Change the footer text on the login page
  19. Changing user_nicename
  20. Redirect to Page after Post Submit
  21. problem with ajax and the path to the php page
  22. Can i check if user is doing any ajax request?
  23. How to use wp_localize_script in a WordPress page other than functions.php?
  24. Admin Media grid view images won’t load
  25. Comparing arrays within a loop
  26. Real time Duplicate title check
  27. Ajax template: how to handle head section
  28. Passing JSON data from WP Query into AJAX causing NULL errors
  29. simple wordpress ajax plugin not working when not logged in
  30. Load custom field value into div with AJAX
  31. Security – Ajax and Nonce use [closed]
  32. AJAX / Read More: multiple check_ajax_referer() and wp_create_nonce() not working independentely
  33. Jquery ajax to custom php file: returning blank data
  34. Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
  35. Accessing a random image via ajax
  36. PHP calling AJAX function that relies on passed PHP function values not working
  37. WordPress 4 invalid username special charachters issue
  38. Update WordPress Custom Field with AJAX on cached page
  39. How to place login logout link on menu that redirects users back to current page?
  40. How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
  41. Looking for a better way to handle an ajax script that pulls in post data on click
  42. Targeting single page with JS
  43. Data fetch and delete by ajax request
  44. Handling an Ajax form submit
  45. Ajax call to my WordPress website from an external application [duplicate]
  46. How to resolve error “Cookies are blocked due to unexpected output.”?
  47. Making a follow button, Ajax not talking to php
  48. How to add default images into theme customizer image control?
  49. Using a nonce in a Custom Login Form
  50. Can’t use get_results() in ajax query
  51. Is the regular ajax request method safe or I should use admin-ajax.php?
  52. automated tests as a user?
  53. Debugging PHP object during Ajax call in WordPress
  54. Validate a users email address when using gmail to register
  55. Custom WordPress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB
  56. WordPress Ajax Data problem
  57. Use ajax to update_post_meta
  58. Problem with WordPress Ajax form
  59. Remove username in emails or swap username for email
  60. Click loads template via ajax
  61. woocommerce and is_user_logged_in() if not redirect to homepage
  62. Display notification only once
  63. admin-ajax.php returning error 400 namespaced callback
  64. AJAX in WordPress, sending coords data to MySQL and show after into map
  65. How to retrieve the content (with a specific ID) via ajax by clicking a link tag
  66. WooCommerce: update custom fields after checkout validation failure
  67. Access/update database with jQuery
  68. How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
  69. Passing jQuery value using Ajax to a page template
  70. How to set a custom path, for ajax image upload folder in admin?
  71. admin-ajax.php responding with 0
  72. Check if user is logged in when clicking certain links on certain pages
  73. Ajax form submit within a Post Metabox
  74. ajax_object is not defined when ajax calls the function
  75. How to speed up admin-ajax.php in wordpress
  76. PHP If user is logged in & on home page redirect
  77. WordPress shows registration link for non logged users
  78. Returning a value from a PHP page
  79. Page Reloads Before AJAX Request Finishes
  80. WordPress File handle – fopen, fwrite not working with $.ajax or $.post Jquery
  81. Can I use HTTP POSTs? Is there a better alternative?
  82. Why is this Ajax not working?
  83. Stumped – Ajax Response Returns 0
  84. Creating login session via CURL
  85. Colorbox ajax loading of outside HTML content works perfect on localhost but not on server
  86. How to make custom total price reactive in navigation
  87. Put CSS inside a PHP file and include it the right way
  88. Sending jsPDF documents to the server
  89. Ajax $wpdb not returning table data
  90. Admin username and password
  91. How to prevent those PHP variables from being cached on WordPress?
  92. Use ajax from function.php
  93. Ajax return code 400
  94. How to Fetch values from WP database based on selected option value by onchange using PHP?
  95. wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
  96. doing an ajax request always outputs 0
  97. Recovering WP Login Credintials in Code?
  98. How to run JS, PHP and etc. inside WP post?
  99. Trying to implement Ajax comments in WordPress, getting WP error
  100. How to test nonce with AJAX – Plugin development
Categories PHP Tags ajax, login, php
How to keep a check box in custom meta box for custom post type checked by default for add new post?
How to add multiple featured image in meta box in post editor?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress