Thread HTML::Form ein <select> hinzufügen (19 answers)
Opened by bianca at 2023-07-21 12:04

bianca
 2023-07-21 12:04
#195149 #195149
User since
2009-09-13
6990 Artikel
BenutzerIn

user image
Guten Tag!

Habe ein CPAN:HTML::Form Objekt und befülle damit munter ein HTML Objekt mit <input> vom Typ hidden und text aber zu <select> finde ich in der Doku nur einen einzigen Hinweis bei #push_input aus dem ich nicht schlau werde:
Quote
For a <select> element without the multiple attribute there will be one input object of type of "option". For a <select multiple> element there will be one input object for each contained <option> element. Each one of these option objects will have the same name.

Bei versteckten Feldern sieht das so aus:
Code (perl): (dl )
1
2
3
4
5
6
7
$tmp->{formref}->push_input(
    ('hidden'),
    {
        name    => 'honeypot',
        value   => 'erwischt',
    }
);

Weiß jemand wie man <select> neu einfügt und wie man in einem bestehenden die gewünschte Auswahl trifft und würde das bitte hier zeigen?
Danke!
10 print "Hallo"
20 goto 10

View full thread HTML::Form ein <select> hinzufügen