Gossamer Forum
Home : Products : DBMan : Installation :

Default Values not being Entered

Quote Reply
Default Values not being Entered
Anyone seen a problem whereby the default value for a field is ignored? Here's my relevent config. The problem I'm having is with the received mail field. All new users are having a null value put in by default.
Code:
db_def = (
'FirstName' => [0, 'alpha', 20, 255, 1, '', ''],
'LastName' => [1, 'alpha', 20, 255, 1, '', ''],
'Email' => [2, 'alpha', 20, 255, 0, '', '.+@.+..+'],
'HomeNumber' => [3, 'numer', 20, 255, 0, '', '\d{1}'],
'WorkNumber' => [4, 'numer', 20, 255, 0, '', '\d{1}'],
'Mobile' => [5, 'numer', 20, 255, 0, '', '\d{1}'],
'CurrentJob' => [6, 'alpha', '40x5', 1000, 0, '', ''],
'ID' => [7, 'alpha', -1, 255, 0, '', ''],
'UserID' => [8, 'alpha', -1, 255, 0, '', ''],
'Receive Mail' => [9, 'alpha', -1, 255, 0, 'Yes', 'Yes|No']
);


Thanks

-< Obelix >-
Quote Reply
Re: Default Values not being Entered In reply to
If you are not using auto-generate, make sure that your fields in the sub html_record routine look like the following:

Code:

<input type="TEXT" name="FieldName" value="$rec{'FieldName'}">


AND for TEXTBOXES, use the following codes:

Code:

<textarea name="FieldName" ROWS="8" COLS="40" MAXLENGTH="255">$rec{'FieldName'}</textarea>


Regards,

Eliot Lee
Quote Reply
Re: Default Values not being Entered In reply to
Cheers. That fixed it straight away. I added the line

<input type="hidden" NAME="Receive Mail" VALUE="$rec{'Receive Mail'}">

and it all started working.

Thanks for your help.

-< Obelix >-
Quote Reply
Re: Default Values not being Entered In reply to
You're welcome...However, why are keeping the ReceiveEmail field hidden??? How are your users going to choose whether they want email messages or not??

Regards,

Eliot Lee