You've got a static argument list, so there's no way to "delete" them short of editing the code. So instead of hard-coding it what you need to do: build up the argument list in a variable, adding in the onfoo attributes if needed, then pass that dynamic list to the textfield method.
my @textfield_args = ( -name => 'name', ..., -maxlength => 120, ); if( $was_no_change ) { push @textfield_args, -onfocus => 'this.value = ''"; push @textfield_args, -onblur => 'this.value = 'def'"; push @textfield_args, -onchange => 'delete onfocus, delete onblur"; } $string .= $cgi->textfield( @textfield_args );
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: CGI delete attributes set in textfield()
by Fletch
in thread CGI delete attributes set in textfield()
by KaiAllard_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |