Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 12 Years, 3 Months, 1 Week ago How can I make this radio button validate?
#1
Solved: 12 Years, 3 Months, 1 Week ago
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>
#2
Solved: 12 Years, 3 Months, 1 Week ago
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
#3
Solved: 12 Years, 3 Months, 1 Week ago
(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
#4
Solved: 12 Years, 3 Months, 1 Week ago
Well done vernier http://vernier.me/Thread-Checkbox-Validation


Forum Jump:


Users browsing this thread: 1 Guest(s)