Zum Inhalt springen

userFunc > Auswahl speichern

Erstellt am 14. April 2006 · 3 Antworten · letzte Antwort am 15. April 2006

Tags: Frage

just2b ·

Hi,

wie kann ich bei folgender Userfunction die Auswahl des Dropdowns speichern? Bei mir wird immer der erste Wert (SIMPLE) gespeichert.

<?php
class user_class {

    function user_test ($PA, $fobj)    {
    	global $BE_USER;

			$ausgabe = '<select name="mode">';
			if ($BE_USER->check("non_exclude_fields",'tx_rgpopup_mode'.":".'simple')) $ausgabe .= '<option value="simple">SIMPLE</option>';
			if ($BE_USER->check("non_exclude_fields",'tx_rgpopup_mode'.":".'pro')) $ausgabe .= '<option value="simple">PRO</option>';
			if ($BE_USER->check("non_exclude_fields",'tx_rgpopup_mode'.":".'adv')) $ausgabe .= '<option value="simple">ADVANCED</option>';
			$ausgabe .= '</select>';

			return $ausgabe;
    }
}
?>

danke!
georg

steffenk ·

müsste so aussehen:

$ausgabe = '<select name="mode">';
$ausgabe .= '<option value="simple" '.($BE_USER->check("non_exclude_fields",'tx_rgpopup_mode'.":".'simple') ? 'selected="selected"' : '').'>SIMPLE</option>';
$ausgabe .= '<option value="pro" '.($BE_USER->check("non_exclude_fields",'tx_rgpopup_mode'.":".'pro') ? 'selected="selected"' : '').'>PRO</option>';
$ausgabe .= '<option value="adv" '.($BE_USER->check("non_exclude_fields",'tx_rgpopup_mode'.":".'adv') ? 'selected="selected"' : '').'>ADVANCED</option>';
$ausgabe .= '</select>';

... ohne gewehr 😉

just2b ·

jetzt wird leider automatisch das letzte immer ausgewählt, gespeichert wird aber nichts/das erste

georg

just2b ·

Naja ein Blick in den Quellcode und bei nachbar feldern abschauen
=>

<select name="data[tt_content][122][pi_flexform][data][sDEF][lDEF][display][vDEF]_hr">

lg georg