CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Subrouting option does not disable text box.

 



kmitchell
New User

Aug 11, 2011, 11:16 AM

Post #1 of 2 (1553 views)
Subrouting option does not disable text box. Can't Post

Hello,

I'm trying to customize a module in Webmin. There is a sub that doesn't appear to work as the notes say. I want to disable certain text boxes. I set the value to "1" as the notes state but the text box is still editable. What am I missing? Here is the code block:

=head2 ui_up_textbox(name, value, size, [disabled?], [maxlength], [tags])

Returns HTML for a text input box. The parameters are :

=item name - Name for this input.

=item value - Initial contents for the text box.

=item size - Desired width in characters.

=item disabled - Set to 1 if this text box should be disabled by default.

=item maxlength - Maximum length of the string the user is allowed to input.

=item tags - Additional HTML attributes for the <input> tag.

=cut
sub ui_up_textbox
{
my ($name, $value, $size, $dis, $max, $tags) = @_;
$size = &ui_max_text_width($size);
return "<input class='ui_up_textbox' name=\"".&quote_escape($name)."\" ".
"value=\"".&quote_escape($value)."\" ".
"size=$size ".
($dis ? "disabled=true" : "1").
($max ? " maxlength=$max" : "").
" ".$tags.
">";
}


This option is the one in question: ($dis ? "disabled=true" : "").
I changed it to: ($dis ? "disabled=true" : "1").


FishMonger
Veteran / Moderator

Aug 11, 2011, 1:55 PM

Post #2 of 2 (1543 views)
Re: [kmitchell] Subrouting option does not disable text box. [In reply to] Can't Post

You changed the wrong thing. You need to change the value being passed to the sub, not the sub itself.

I don't use webmin, I'd say there should be a section of the web page that allows you to set that value.


(This post was edited by FishMonger on Aug 11, 2011, 1:56 PM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives