hi,
i'm writing a new drupal module that adds some custom fields to the user registration form.
One of these fields is marked as required=true and has no default value.
If user leaves this field empty, he gets a notification message ('XXX field is required') - that's ok.
However - even if he nows fills it in, message still appears!
I narrowed it down to this -
if i set the "default value" of this field to something, this does not happen. However, behavior is still not ok - the default value gets filled, and not the "empty" value.
I looked a few times at the profile module code, and it seems we're doing the same thing - and i do not get that behavior when using the profile module (it is not enough for me, so i have to write my own).
can anyone help with this?
below is the relevant code subset (pretty straight forward):
Noam,
-------------------------------
function qm_reg_user($type, &$edit, &$user, $category = NULL) {
switch ($type) {
case 'register':
{
$form['Community'] = array('#type' => 'fieldset', '#title' => 'Community', '#weight' => 1);
$form['Community']['Credit Card'] = array('#type' => 'textfield',
'#title' => 'Credit Card',
'#default_value' => $edit['Credit Card'],
'#maxlength' => 255,
'#description' => 'Please enter your credit card number',