Forums

Profile plugin form: one field not loading

phlampe 02 Jun, 2010
Hello All !

I have a profile form made from a copy of the original one and configured with the Profile plugin.

There are several fields in it, mainly text, but 3 drop-down boxes. The last one (list select_26) doesn't display the value from the data table, and I don't understand why...

Here's the code for the last 2 drop-down boxes:

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Nature de l'organisation</label>
    <select class="cf_inputbox validate-selection" id="select_25" size="1" title=""  name="nature_organisation">
    <option value="NA">Choisissez une option...</option>
<option value="Association">Association</option>
<option value="Individu">Individu</option>
<option value="Grande Entreprise">Grande Entreprise</option>
<option value="PME/TPE">PME/TPE</option>
<option value="Organisme de recherche">Organisme de recherche</option>
<option value="Autre">Autre</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Domaine d'activité</label>
    <select class="cf_inputbox validate-selection" id="select_26" size="1" title=""  name="domaine">
    <option value="NA">Choisissez une option...</option>
<option value="Biotech_environnement/énergie">Biotech environnement/énergie</option>
<option value="Biotech_industrielle">Biotech industrielle</option>
<option value="Biotech_médicale">Biotech médicale</option>
<option value="Diagnostic">Diagnostic</option>
<option value="Equipement_médical">Equipement médical</option>
<option value="Pharma">Pharma</option>
<option value="TIC_R&D">TIC R&D</option>
<option value="TIC_Santé">TIC Santé</option>
<option value="Autre">Autre</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>
</div>


And here's the html code that's generated:

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Nature de l'organisation</label>
    <select class="cf_inputbox validate-selection" id="select_25" size="1" title=""  name="nature_organisation">
    <option  value="NA">Choisissez une option...</option>
<option  value="Association">Association</option>

<option  value="Individu">Individu</option>
<option  value="Grande Entreprise">Grande Entreprise</option>
<option selected="selected" value="PME/TPE">PME/TPE</option>
<option  value="Organisme de recherche">Organisme de recherche</option>
<option  value="Autre">Autre</option>

    </select>
    
  </div>
  <div class="cfclear"> </div>

</div>

<div class="form_item">
  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Domaine d'activité</label>
    <select class="cf_inputbox validate-selection" id="select_26" size="1" title=""  name="domaine">
    <option  value="NA">Choisissez une option...</option>
<option  value="Biotech_environnement/énergie">Biotech environnement/énergie</option>
<option  value="Biotech_industrielle">Biotech industrielle</option>

<option  value="Biotech_médicale">Biotech médicale</option>
<option  value="Diagnostic">Diagnostic</option>
<option  value="Equipement_médical">Equipement médical</option>
<option  value="Pharma">Pharma</option>
<option  value="TIC_R&D">TIC R&D</option>
<option  value="TIC_Santé">TIC Santé</option>
<option  value="Autre">Autre</option>

    </select>

    
  </div>
  <div class="cfclear"> </div>
</div>


One can see the "selected" value in the first list, but not the second, eventhough the data was present in the table. Furthermore, I don't understand why it's working well in the original form, and not the copied "profile" one.

And I checked for missing quotes (never know... I hope it's not *that* dumb mistake...)

Thanks for your help,
Paul-Henri
GreyHead 02 Jun, 2010
Hi Paul-Henri,

I don't see anything obviously wrong there. Have you checked that the data is being saved correctly in the database table and that the column name matches exactly to the input name?

Bob
phlampe 02 Jun, 2010
Yes, the data is saved correctly by the input form (the first one I made), and I checked it my phpMyAdmin. What's also surprising me, it's that the second form I made (the Profile one) is basically a copy of the first one, and it doesn't work.

I'll have to try what's suggested in this thread Autogenerated Code -- Is there any way to modify this?, but next week since I'm away from my office for 5 days.

Cheers,
Paul-Henri
phlampe 09 Jun, 2010
Hello All !

Dropping and restoring the DB connection didn't work. But I noticed the problem happens only on the items of my list where the value had an accented character in it (like "<option value="Biotech_médicale">Biotech médicale</option>"), and it happened by chance that the first list didn't have any such values.

So I changed my values and removed all the accented characters and it works well now like this: "<option value="Biotech_medicale">Biotech médicale</option>"

I'll add that the accented value is correctly stored by the form when the Submit button is pressed, it's in the (re)load part of the form that something gets messed up by the accented character and prevents it from generating the "selected" line.

Cheers,
Paul-Henri
This topic is locked and no more replies can be posted.