The question I have is quite general, but I will make it more specific by providing my own use case.
Instead of using forms on my websites, I rely on ajax calls to php services. Essentially, I utilize stylized spans with "click" events attached to them, which then trigger an ajax request to send data to the server.
- No
<form>
element, - No
<input type="submit">
element. - If javascript is disabled, then nothing will function as intended (whether this is a desirable outcome is not the focus of this post).
However, I still want to ensure that no cunning bot generates garbage data through my "forms".
Therefore, my inquiry is: is it necessary to implement a captcha or some other form of bot protection in this scenario?
Below is the approach I have decided to take based on the provided response:
html:
<form id="honeypotform" action="http://whatever.com">
<input type="text" id="formbody">
<input type="submit" id="submitbtn" value="Submit">
</form>
css:
#honeypotform { display: none; }
The actual submission link:
<span onclick="do();">Submit</span>
The function of the link:
function do() {
if (formbody.value != "") return true;
/* ... */
}
I will provide an update on the outcomes of this approach in a follow-up post after a few days.