[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Updating Database using form - Select Multiple
I am using IC 4.8.2.
I have a form which I use to update a table in my catalog. All worked
fine, until I tried to have a select element, which allows multiple
selections. The only value which gets written to that database is the
first value selected.
Here is a stripped down version of my form:
<FORM METHOD=POST ACTION="[process]">
<INPUT TYPE=HIDDEN NAME="mv_data_table" VALUE="members_sf">
<INPUT TYPE=HIDDEN NAME="mv_data_key" VALUE="m_code">
<INPUT TYPE=HIDDEN NAME="mv_data_function" VALUE="update">
<INPUT TYPE=HIDDEN NAME="mv_nextpage" VALUE="profileedit">
<INPUT TYPE=HIDDEN NAME="mv_update_empty" VALUE="1">
<INPUT TYPE=HIDDEN NAME="mv_data_fields" VALUE="m_code,m_pets">
<select name="m_pets" MULTIPLE>
<option value="Dog,">Dog
<option value="Cat,">Cat
<option value="Rabbit,">Rabbit
</select>
<input type=submit>
</form>
I added a [cgi m_pets] tag to the top of the mv_nextpage to see what is
returned. When multiple options are selected the [cgi] tag contains all
those options eg 'Dog,Cat,Rabbit,', however only Dog, will be written to
the database.
If possible I would like to avoid having to use javascript to
concatenate all selected options on submission of the form. Does the
method I use for updating the DB support 'select multiple'? Any tips
would be appreciated.
Thanks
Mat