4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: TIMT on May 08, 2006, 10:38:08 PM

Title: DropDownList in upload_form
Post by: TIMT on May 08, 2006, 10:38:08 PM
Hi everybody

I have implemented the following code in memper_uploadform.html:

Code: [Select]
<td class="row1">
             <select class="input name="image_medium" size="1">
               <option value="Digitalaufnahme">unbekannt</option>
               <option value="Digitalaufnahme">Digitalaufnahme</option>
               <option value="Dia Kleinbild">Dia Kleinbild</option>
               <option value="Dia Mittelformat">Dia Mittelformat</option>
               <option value="Dia Grossformat">Dia Grossformat</option>
               <option value="Negativ Kleinbild">Negativ Kleinbild</option>
               <option value="Negativ Mittelformat">Negativ Mittelformat</option>
               <option value="Negativ Grossformat">Negativ Grossformat</option>
             </select> 

I have implemented the following Code in db_field_definition.php

Code: [Select]
$additional_image_fields['image_medium'] = array($lang['image_medium'], "text", 0);
I created the filed image_medium in the table 4images_images and 4images_images_temp

Unfortunately the value entered by Dropdownlist is not be stored in the database.

So what did I wrong???

Thanks for helping me.

TIMT
Title: Re: DropDownList in upload_form
Post by: V@no on May 09, 2006, 01:10:32 AM
What type is your new field? It should be either VARCHAR(XX) or TEXT

P.S. make sure you added the line in db_field_definitions.php not inside the comment ;)
Title: Re: DropDownList in upload_form
Post by: TIMT on May 09, 2006, 07:15:06 AM
when I replace the following code

Code: [Select]
<tr>
            <td class="row1"><b>Originalmedium</b></td>
            <td class="row1">
             <select class="input name="image_medium" size="1">
               <option value="Digitalaufnahme">unbekannt</option>
               <option value="Digitalaufnahme">Digitalaufnahme</option>
               <option value="Dia Kleinbild">Dia Kleinbild</option>
               <option value="Dia Mittelformat">Dia Mittelformat</option>
               <option value="Dia Grossformat">Dia Grossformat</option>
               <option value="Negativ Kleinbild">Negativ Kleinbild</option>
               <option value="Negativ Mittelformat">Negativ Mittelformat</option>
               <option value="Negativ Grossformat">Negativ Grossformat</option>
             </select> 
            </td>
         </tr>

with this code:
Code: [Select]
<input type="text" name="image_medium"  size="4" value="{image_medium}" class="inputjahr" />
it works. The value entered in the new field is stored in the database.

But I'd like this dropdownlist above. Something is wrong with the dropdownlist. Where in the dropdownlist is the field in the database defined? Ist that name=?
Title: Re: DropDownList in upload_form
Post by: V@no on May 09, 2006, 07:57:35 AM
you are missing a quote:[qcode]             <select class="input" name="image_medium" size="1">
[/qcode]
Title: Re: DropDownList in upload_form
Post by: TIMT on May 09, 2006, 08:34:58 AM
Thank you!!!!    :D :oops:
Title: Re: DropDownList in upload_form
Post by: Melder on November 21, 2006, 11:05:26 AM
Hi,

wie kann ich in ein Dropdown-Menü Text eingeben, welcher aber nicht gewählt werden kann? (als Überschriften um da eine gewisse Struktur reinzubekommen)

thx Achim
Title: Re: DropDownList in upload_form
Post by: pda on November 21, 2006, 12:50:20 PM
Look at this example here to "organise" your dropdown box
A group can be made with the help of the <optgroup> tag


Code: [Select]
<select name="subject">
    <optgroup label="First Group">
          <option>Option 1</option>
          <option>Option 2</option>
          <option>Option 3</option>
    </optgroup>

   <option disabled="disabled" value="">This is an option tag which can`t be selected</option>

    <optgroup label="Another Group">
          <option>Option 1</option>
          <option>Option 2</option>
          <option>Option 3</option>
    </optgroup>

  <option>this is just an normal option tag</option>
</select>
Title: Re: DropDownList in upload_form
Post by: Melder on November 21, 2006, 02:08:09 PM
Perfekt, genau das habe ich gesucht!!! Viele Dank - Thank you  :D