Thread CGI.pm + sticky Parameter: Verständnisfrage (12 answers)
Opened by GwenDragon at 2006-01-28 19:40

GwenDragon
 2006-01-29 16:39
#6806 #6806
User since
2005-01-17
14563 Artikel
Admin1
[Homepage]
user image
Quote
CREATING FILL-OUT FORMS:

General note The various form-creating methods all return strings to the caller, containing the tag or tags that will create the requested form element. You are responsible for actually printing out these strings. It's set up this way so that you can place formatting tags around the form elements.

Another note The default values that you specify for the forms are only used the first time the script is invoked (when there is no query string). On subsequent invocations of the script (when there is a query string), the former values are used even if they are blank.

If you want to change the value of a field from its previous value, you have two choices:

(1) call the param() method to set it.

(2) use the -override (alias -force) parameter (a new feature in version 2.15). This forces the default value to be used, regardless of the previous value:

  print $query->textfield(-name=>'field_name',
                          -default=>'starting value',
                          -override=>1,
                          -size=>50,
                          -maxlength=>80);


Steht in der CGI-Doku von CGI 3.0

Das bedeutet, dass der beim ersten Aufruf des Skriptes übergebene Wert mit dem als -default angegebenen Wert überschrieben wird.\n\n

<!--EDIT|GwenDragon|1138546312-->
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread CGI.pm + sticky Parameter: Verständnisfrage