General Question

PupnTaco's avatar

In an HTML web form, how to create a checkbox that will block submission of the form unless checked?

Asked by PupnTaco (13860points) September 1st, 2008

Ugh, I hate this stuff. I have a web form that will either send its contents to a SQL database or to an e-mail. My client wants to block submission of the form unless an “I agree” checkbox is ticked. How the heck do I do this?

Observing members: 0 Composing members: 0

3 Answers

Vincentt's avatar

It’s easily circumventable (is that actually a word?) (see the “Tamper Data” Firefox extension), but I suppose you can convince your client you’ve done it using Javascript (not sure how to do that though). However, be sure to do server-side validation as well, because, as I said, it’s easy to work around (you can just disable Javascript).

jrpowell's avatar

You could try something like this

View the source. It is pretty simple.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther