Gossamer Forum
Home : Products : DBMan SQL : Discussion :

How to create select field?

Quote Reply
How to create select field?
How to create a new column, which will result following Select form HTML code?:
Code:
<select name="test">
<option value="" selected>Please select a value</option>
<option value="(1) value1">(1) value1</option>
<option value="(2) value2">(2) value2</option>
<option value="(3) value3">(3) value3</option>
<option value="(4) value4">(4) value4</option>
</select>


The select form should have no default value selected or selected the "Please select a value" only.
The user must select a value so it should be NOT NULL, but should have no default value.

Currently the added 'test' column looks like this in the .def file:
Code:
'test' => {
'file_max_size' => '',
'file_save_in' => '',
'file_save_scheme' => 'HASHED',
'file_save_url' => '',
'form_display' => 'Test',
'form_names' => [
'(1) value1',
'(2) value2',
'(3) value3',
'(4) value4'
],
'form_size' => '',
'form_type' => 'SELECT',
'form_values' => [
'(1) value1',
'(2) value2',
'(3) value3',
'(4) value4'
],
'not_null' => '1',
'pos' => '8',
'regex' => '',
'type' => 'ENUM',
'values' => [
'(1) value1',
'(2) value2',
'(3) value3',
'(4) value4'
],
'weight' => ''
}


But the problem is, that <%Dbsql::HTML::generate_select('test')%> doesn't generate the awaited select HTML code. It always has a selected value, but should be not selected by default:
Code:
<select name="test">
<option value="(1) value1">(1) value1</option>
<option value="(2) value2">(2) value2</option>
<option value="(3) value3">(3) value3</option>
<option value="(4) value4">(4) value4</option>
</select>


Any ideas, how to setup the column, to have the correct select HTML code generated?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Apr 29, 2005, 4:32 PM
Subject Author Views Date
Thread How to create select field? webmaster33 3827 Apr 29, 2005, 4:17 PM
Thread Re: [webmaster33] How to create select field?
jai 3762 Apr 30, 2005, 3:54 AM
Thread Re: [jai] How to create select field?
webmaster33 3767 Apr 30, 2005, 11:14 AM
Thread Re: [webmaster33] How to create select field?
604 3803 May 2, 2005, 9:28 AM
Post Re: [TheStone] How to create select field?
webmaster33 3765 May 2, 2005, 9:37 AM
Thread Re: [TheStone] How to create select field?
webmaster33 3756 May 2, 2005, 3:49 PM
Thread Re: [webmaster33] How to create select field?
604 3766 May 2, 2005, 3:51 PM
Post Re: [TheStone] How to create select field?
webmaster33 3753 May 3, 2005, 4:04 AM
Post Re: [TheStone] How to create select field?
webmaster33 3716 May 4, 2005, 8:33 PM