Index: nodequeue.module
===================================================================
--- nodequeue.module	(revision 2286)
+++ nodequeue.module	(working copy)
@@ -1094,9 +1094,16 @@
   $form['add'] = array(
     '#type'   => 'markup',
   );
+  
+  //calculate maxlength of textfield dynamically, e. g. Testsite [nid: XXX}  
+  $node = db_fetch_object(db_query("SELECT nid FROM node ORDER BY nid DESC limit 1")); //get highest node id
+  //node title column length + length of highest node id + static snippet [nid: ] (7 characters)
+  $maxlength = 255 + strlen($node->nid) + 7;
+ 
   $form['add']['nid'] = array(
     '#type' => 'textfield',
     '#autocomplete_path' => 'nodequeue/autocomplete/'. $subqueue->sqid,
+    '#maxlength' => $maxlength, 
     '#default_value' => t('Enter the title of a node to add it to the queue'),
   );
   $form['add']['submit'] = array(
