jquery - HTML Form action with multiple values -


this question related previous post, think mine somehow different.

i'm trying implement sort of spam check image. i'm using picture of callaway golf ball , asking brand is.

is there way accept both capitalized, , lowercase answers? i'm trying figure out , can't. guess real question is:

can accept 2 answers in value?

the easy fix use image or ask question doesn't involve capitalization, want use golf ball thing.

if i'm understanding question correctly, there 1 right answer, issue client might enter correct string, using wrong casing. correct me if i'm wrong in understanding question.

you can use javascript transform answers lower case , compare results. transform string lowercase use .tolowercase().

here's working example form:

<script>     function checkform() {        var elem = document.getelementbyid('myinput');        elem.value = elem.value.tolowercase();        return elem.value.length > 0;     } </script> <form action="somewhere.php" method="post" onsubmit="checkform()">     <input id="myinput" type="text">     <button type="submit">submit</button> </form> 

ideally though, if there's server side component should lower case transformation there. note jquery not needed - pure js :)


Comments