As the code is right now, there are 2 pages that handle the input.
The first page where the user types in the info,
Code:
<form id="foofield" name="foofield" method="post" action="2ndpage.php" onsubmit='return validateMyForm(this)'>
<input name="some_foo" type="text" id="some_foo" maxlength="50" />
which is validated by a .js function. All that really does it make sure the user is putting something in those fields if required and if they're formatted correctly. The .js also looks at the captcha, just to make sure that something, anything was written in before the page is allowed to be submitted.
The second is where the captcha input is actually validated against the code. Its at the top of a nested if statement. Inside, where the rest of the input I want to the DB looks like
Code:
$foo = $sql_session->real_escape_string($_POST['some_foo']);
so I guess my question is, how do I make it so the user doesn't have to type 'foo' all over again when they get kicked back to the first page when they flub the captcha.
Or could it be done/would it be a bad idea to let the .js handle this?