wurm: Pulldown Menu

.. hallo möchte in folgende if anweisung:
if ($ad_1_text)
{

print("<tr>");
  print("<td width="50%" valign="top"> $ad_1_text </td>");
  print("<td width="50%" valign="top">");
  print("<input type='Dropdown' name="custom_field_1" size="29" class='txt' value="$custom_field_1" />");
  print("</td>");
  print("</tr>");
}
ein Pulldown Menu zur Auswahl einfügen ... bekomm es aber irgendwie nicht hin kann mir jemand helfen???????

  1. Hi Wurm,

    print("<input type='Dropdown' name="custom_field_1" size="29"

    Hier liegt der Fehler begraben... es gibt kein input type="dropdown"
    Ein Dropdown-Menue erhaelst du, wenn du ein select mit size="1" erstellst.

    MFG

    Philipp

    1. ´Hy Philipp

      wie soll ich einen select erstellen? input type=select ??

      1. wie soll ich einen select erstellen? input type=select ??

        so:

        <form method="POST" action="file.php">
          <select size="1" name="custom_field_1">
            <option value="value1">Dies ist</option>
            <option value="value2">ein</option>
            <option value="value3">Pulldownmenue</option>
          </select>
          <input type="submit" value="Abschicken">
        </form>

        Philip

        1. ... also so weit ist es mir ja klar ich weiß nur nicht wie ich das in die if schleife einbauen soll .. hab es jetztnso prob. .. funkt. so aber natürlich nich!
          if ($ad_1_text)
          {
            print("<form method="POST" action="search.php">");
            print("<select size="1" name="custom_field_1">");
            print("<option value="value1">Dies ist</option>");

          1. ... ach so brauche keinen submit button weil ich noch mehrere if anweisungen habe

            1. ... hy also so weit funktioniert es jetzt nur übergibt er das suchwort nicht richtig oder gar nicht dem script! .. was kann das jetzt noch sein?
              print("<tr>");
                print("<td width="50%" valign="top"> $ad_1_text </td>");
                print("<td width="50%" valign="top">");
                print('<form method="POST" action="search.php">');
                 print('<select size="1" name="custom_field_1">');
                 print('<option value="custom_field_1">New</option>');
                 print('<option value="custom_field_1"><1 Month</option>');
                 print('<option value="custom_field_1">2-6 Months</option>');
                 print('<option value="custom_field_1">6-12 Months</option>');
                 print('<option value="custom_field_1"><1 Year</option>');
                 print('<option value="custom_field_1"><2 Years</option>');
                 print('<option value="custom_field_1"><3 Years</option>');
                 print('<option value="custom_field_1"><4 Years</option>');
                 print('<option value="custom_field_1"><5 Years</option>');
                 print('<option value="custom_field_1">over 5 Years</option>');
                 print('</select>');
                 print('<value="$custom_field_1" />');
                print("</td>");
                print("</tr>");

          2. ... also so weit ist es mir ja klar ich weiß nur nicht wie ich das in die if schleife einbauen soll .. hab es jetztnso prob. .. funkt. so aber natürlich nich!
            if ($ad_1_text)
            {
              print("<form method="POST" action="search.php">");
              print("<select size="1" name="custom_field_1">");
              print("<option value="value1">Dies ist</option>");

            Das ist klar, dass es da einen Fehler gibt:
            Entweder machst du es so:
               print('<form method="POST" action="search.php">');
               print('<select size="1" name="custom_field_1">');
               print('<option value="value1">Dies ist</option>');

            oder so:
               print("<form method="POST" action="search.php">");
               print("<select size="1" name="custom_field_1">");
               print("<option value="value1">Dies ist</option>");

            Du musst die Anführungszeichen maskieren (letztes Beispiel) oder durch einfache Anführungszeichen ersetzen.

            Philip