]> mj.ucw.cz Git - pciids.git/commitdiff
ID textbox is limited by ID type
authorMichal Vaner <vorner@ucw.cz>
Sun, 31 Aug 2008 18:50:33 +0000 (20:50 +0200)
committerMichal Vaner <vorner@ucw.cz>
Sun, 31 Aug 2008 18:50:33 +0000 (20:50 +0200)
The maxlen property of ID textbox in add item page is set by the type of
the expected ID.

PciIds/Html/Changes.pm

index 57473544d65015e33f36402dbb3d2d146a8173dd..7154b01fe249b3202621644557011dfe68a16a3e 100644 (file)
@@ -18,7 +18,7 @@ sub genNewItemForm( $$$$$$ ) {
        genCustomHead( $req, $args, $address, "$prettyAddr - add new item", [ $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] );
        print "<div class='error'>$error</div>\n" if( defined $error );
        print "<form name='newitem' id='newitem' method='POST' action='".( $args->{'full_links'} ? 'http://'.$req->hostname().$req->uri().buildExcept( 'action', $args ).'?action=newitem' : '' )."'>\n<table>";
-       genFormEx( [ [ 'input', 'Id:', 'text', 'id', 'maxlength="50"' ],
+       genFormEx( [ [ 'input', 'Id:', 'text', 'id', 'maxlength="'.$address->subIdSize().'"' ],
                [ 'input', 'Name:', 'text', 'name', 'maxlength="200"' ],
                [ 'input', 'Note*:', 'text', 'note', 'maxlength="1024"' ],
                [ 'textarea', 'Discussion*:', undef, 'discussion', 'rows="5" cols="50"' ],