Hi all again,

Next Post, next Question. i hope it's ok, to split my questions. I think it's better for research reasons.

I have put a custom extra inputfield (profile module) to the create account process. Filling this field (a numbercode) is optional, but if somebody fill in a "codenumber" and submit the 'registration form', a check against a database table should happen.

If the "codenumber" is not found, the 'create account form' should throw an error-message. No "codenumber" input is ok.

How can I solve this problem, do you have some hints for my?

Please apologize my english, i'm not a native speaker.

Thanks, FranZer

Comments

B00N’s picture

Is there nobody who can help me?

clivesj’s picture

I need this as well, so let's hope for an answer......
See You

B00N’s picture

It's a quick'n'dirty way!

In the user.module:

function _user_edit_validate($uid, &$edit) {}

After the // Validate the username and // Validate the e-mail address validation.

if (arg(1) == 'register' && strlen($edit['profile_XXXX']) != 0) { 
  if (db_num_rows(db_query("SELECT var FROM {table} WHERE value = '%s'", $edit['profile_XXXX'])) == 0) {
    form_set_error('profile_XXXX', t('This value %var was not found. .', array('%var' => $edit['profile_XXXX'])));
  }

I hope this works for you too.

FranZer