MyBB Community Forums

Full Version: How can I make this radio button validate?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have made a radio button but I cannot get it to validate when a post is made.

Basically a user has to check the radio button, if they do not then an error message is presented - but it does not work the reply continues to post as normal.

How can I make this button so that it has to be checked in order for the user to post successfully?

PHP
<?php 

$answer = $_POST['ans'];

    if ($answer == "Not a Spammer") {
        
        echo 'Correct';
        
    }
    
    else {
        
        echo 'Incorrect';
        
    }    
        
?> 

HTML
<form action="spambutton.php" method="post">
  Answer 1 <input type="radio" name="ans" value="Not a Spammer" /><br />
  <input type="submit" value="submit" />
</form>
http://stackoverflow.com/questions/14237...javascript
http://forum.jquery.com/topic/checking-i...is-checked
You might find these threads interesting read for your problem. Smile

==
Also, why do you need custom spam checker?
You might want to read this: http://mybbaddict.com/thread-stop-forum-...ccess-rate
(2012-08-20, 09:39 AM)loveley Wrote: [ -> ]http://stackoverflow.com/questions/14237...javascript
http://forum.jquery.com/topic/checking-i...is-checked
You might find these threads interesting read for your problem. Smile

==
Also, why do you need custom spam checker?
You might want to read this: http://mybbaddict.com/thread-stop-forum-...ccess-rate

Just because it is easier to trick out the spammers when you do it this way and keep changing the php file.

But thanks Smile

Plus I have most of that security in and trust me when you have a conspiracy forum more is better Toungue

I will pay someone to make me a checkbox or radio button anti spam to place in threads and posts, or just get the one I have up there working.

Bids are now welcome please Smile