Auswahlliste html in c

Gast #4126316
Lesenswert?

Guten Tag,

ich habe ein Problem mit String in C

bekomme den Teil nicht compilliert.
könnte mir einer von ihnen weiterhelfen.
mfg
1
  PSOCK_SEND_STR(&s->sout,"\
2
<h2>Eine Dropdown-Liste mit dem &lt;select>-Element
3
  <form action="#"> 
4
    <select name="top5" > 
5
      <option>Rot</option> 
6
      <option>Gruen</option> 
7
      <option>Blau</option> 
8
      <option>Gelb</option> 
9
      <option>Ping</option> 
10
    </select> 
11
  </form>");
Gast #4126345
Lesenswert?

Marc S. schrieb:
> du musst die " escapen

so hab ich

trotzdem gehts nicht
1
  PSOCK_SEND_STR(&s->sout,"\
2
  <h2>Eine Dropdown-Liste mit dem &lt;select>-Element
3
  <form action="\#"> 
4
    <select name="\top5" > 
5
      <option>Rot</option> 
6
      <option>Gruen</option> 
7
      <option>Blau</option> 
8
      <option>Gelb</option> 
9
      <option>Ping</option> 
10
    </select> 
11
  </form>");
Gast #4126389
Lesenswert?

Nimm einfach die einfachen Anführungszeichen (', single quoute) für die 
Attribute, also:
1
  PSOCK_SEND_STR(&s->sout,
2
"<h2>Eine Dropdown-Liste mit dem &lt;select&gt;-Element</h2>\n"
3
"  <form action='#'>\n"
4
"    <select name='top5'>\n" 
5
"      <option>Rot</option>\n"
6
"      <option>Gruen</option>\n"
7
"      <option>Blau</option>\n"
8
"      <option>Gelb</option>\n"
9
"      <option>Ping</option>\n"
10
"    </select>\n"
11
"  </form>\n");

#
Attributes are placed inside the start tag, and consist of a name and a 
value, separated by an "=" character. The attribute value can remain 
unquoted if it doesn't contain space characters or any of " ' ` = < or 
>. Otherwise, it has to be quoted using either single or double quotes.
#
http://www.w3.org/TR/html/introduction.html#a-quick-introduction-to-html
Gast #4126470
Lesenswert?

Schaulus Tiger schrieb:
> Nimm einfach die einfachen Anführungszeichen (', single quoute)
> für die

>
> #
> Attributes are placed inside the start tag, and consist of a name and a
> value, separated by an "=" character. The attribute value can remain
> unquoted if it doesn't contain space characters or any of " ' ` = < or
>>. Otherwise, it has to be quoted using either single or double quotes.
> #
> http://www.w3.org/TR/html/introduction.html#a-quic...

vielen vielen Dank

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren