Jump to content

Predefined input value


scferg

Recommended Posts

Something like this:

 

function submitForm(){
    var val = document.getElementById('myField').value;
    if(val == 14){
        document.myForm.submit();
    }else{
        alert('Invalid Input');
    }
}

 

HTML:

<form name="myForm" action="page.php">
   <input id="myField" name="fieldName" />
   <input type="button value="Submit" onclick="submitForm();">
</form>

Ok, I was using that as a type of CAPTCHA thing. I just needed something simple, but it was dumb of me to do it this way -- the bots have already gotten passed it. I've search all over the internet for a *real* CAPTCHA system, but all of them seem confusing. Like, some require databases and such. Do any of you know of a good CAPTCHA script, or know how to make one?

 

I really appreciate it ;)

 

Sorry, I cannot move this thread; I am not a moderator. You can post a question, similar to this one, in the server side scripting forums; which can be found here:

 

http://www.phpfreaks.com/forums/index.php?action=collapse;c=25;sa=expand#25

 

http://www.phpfreaks.com/forums/index.php?action=collapse;c=27;sa=expand#27

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.