MyBB Community Forums

Full Version: registration validate not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm now realizing this post may be in the wrong location. Sorry If I posted it incorrectly.

I have made some progress on trying to create my custom field however the validation only works once. my custom validation script does run and will validate correctly as long as I am switching between fields. however if I press the submit button once. the validation works and I am told the entry is invalid. if I press submit a second time without changing anything it accepts the entry.

obviously I need it to validate every time.

Does anyone know what I'm missing to make the validation script run even with multiple submit presses?

here is how I have modified the code in member.php
	 if($requiredfields)
		{
			eval("\$requiredfields = \"".$templates->get("member_register_requiredfields")."\";");
			
		}
					///Custom Code
		if($id='fid5'){
				$validator_extra .= "\tregValidator.register('{$id}', 'ajax', {url:'customCode.php', loading_message:'Checking if valid.'});\n";
				///end Custom Code
		} 

all that I have in my customCode.php file right now is this :
<?
header("Content-type: text/xml; charset={$charset}");
if($fid5 == 'abbc')
	{
	
		echo "<success></success>";		
		exit;		
	}
	else
	{
		
		echo "<fail></fail>";
		exit;
	}
?>

everything is working great except that pressing the submit button only works the first time after that it returns the same wrong entry as valid.