]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 281632 : Add javascript to focus/select the voting textbox or checkbox
authortravis%sedsystems.ca <>
Wed, 16 Feb 2005 01:13:02 +0000 (01:13 +0000)
committertravis%sedsystems.ca <>
Wed, 16 Feb 2005 01:13:02 +0000 (01:13 +0000)
Patch by GavinS <bugzilla@chimpychompy.org>   r=wurblzap  a=justdave

template/en/default/bug/votes/list-for-user.html.tmpl

index b7a47e2e0f00da0c7683d130d6f82260c35a6c16..e0d97acb15a8fec488854060a1d5c565cd26058f 100644 (file)
   [% h2 = voting_user.login FILTER html %]
   [% IF canedit %]
     [% title = "Change Votes" %]
+    [% IF bug_id %]
+      [%# We .select and .focus the input so it works for textbox and 
+          checkbox %]
+      [% onload = "document.forms['voting_form'].bug_" _ bug_id _
+                  ".select();document.forms['voting_form'].bug_" _ bug_id _
+                  ".focus()" %]
+    [% END %]
   [% ELSE %]
     [% title = "Show Votes" %]
   [% END %]
@@ -63,7 +70,7 @@
 [% END %]
 
 [% IF products.size %]
-  <form method="post" action="votes.cgi">
+  <form name="voting_form" method="post" action="votes.cgi">
     <input type="hidden" name="action" value="vote">
     <table cellspacing="4">
       <tr>
               [% IF canedit %]
                 [% IF product.onevoteonly %]
                   <input type="checkbox" name="[% bug.id %]" value="1"
-                    [% " checked" IF bug.count %]>
+                    [% " checked" IF bug.count %] id="bug_[% bug.id %]">
                 [% ELSE %]
                   <input name="[% bug.id %]" value="[% bug.count %]"
-                         size="2">
+                         size="2" id="bug_[% bug.id %]">
                 [% END %]
               [% ELSE %]
                 [% bug.count %]