Page 1 of 1

Form not submitting

Posted: Tue May 07, 2013 1:29 pm
by ExtremeGaming
So, I have created an extra spam prevention feature to rule out most basic spam bots. Using a text field with display none. The problem is, it works fine with JavaScript enabled, but with it disabled, the form does not submit, as though it was being blocked by JavaScript...but it's disabled. However, as soon as I remove the field, the form submits.

Here is the form code (if you need more let me know). I honestly can not see what could be wrong.
<form method="post">
	<input type="text" name="token" value="" style="display: none;" />
	<input type="text" id="chat_text" placeholder="Enter Message..." maxlength="250" name="chat_mes" />
</form>

Re: Form not submitting

Posted: Wed May 08, 2013 4:40 am
by Helx
In the <form> tag put: action="".
This will submit the form to the current page.

Re: Form not submitting

Posted: Wed May 08, 2013 1:16 pm
by ExtremeGaming
Even without the action it would work. But just for kicks I tried it, and it also did not work.

Edit: I'm an idiot. I forgot forms that use an enter key to submit also require a submit button. Due to my usual handling the form submission by enter key with javascript, I never needed one.