Hey! I am just wondering:
If I want a form to send a AJAX request instead of sending the user to another page or same page; can I <form action="javascript:sendRequest()" ?

Well, you can:

<form action='' method='post' onsubmit='sendRequest(); return false;'>

Keep in mind that you need to write the function yourself: retrieve all variables from the form and send them along with the AJAX request.

Also you will have to notify the user that the form is submitted by hiding the form and showing a message, else they might spam click the submit button.

~G

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.