Commits

Owen Nelson committed e53a797

more cleanup. Markup does not need to be obfuscated since we are not 'in the DOM'

Comments (0)

Files changed (2)

jquery.progressive-btns.js

             $container.addClass('btn-group');
             $container.attr('data-toggle', 'buttons-radio');
             
+            // the name we need to send data as (in the submitted form).
             var input_name = $inputs.eq(0).attr('name');
-            var sender_attrs = {'type': 'hidden',
-                                'name': input_name };
+
             // The sender will be used to transmit the selected value with 
             // the form on submit.
             var $sender = null;
             // we specify it in the initial node creation
             if(settings.debug){
                 // allows us to see the field for debugging
-                $sender = $('<'+'input type="text" readonly="readonly"/>');
+                $sender = $('<input type="text" readonly="readonly"/>');
             } else {
-                $sender = $('<'+'input type="hidden"/>');
+                $sender = $('<input type="hidden"/>');
             }
             
             $sender.attr('name', input_name);
             
-            
-            
-            
             // clear the existing content and setup the hidden input
             $container.html($sender);
             
             $inputs.each(function(){
                 var label = $.trim($(this).parent().text());
                 var val = $(this).val();
-                $btn = $('<'+'a href="#" class="btn"><'+'/a>')
+                $btn = $('<a href="#" class="btn"><'+'/a>')
                         .addClass('btn')
                         .data('value', val).text(label);
                 if($(this).is(':checked')){ // to setup items that are checked already
 </head>
 <body>
 <form action="" method="get">
+    
     <p>Just a set of radio buttons that will turn fancy at the drop of a hat.</p>
     <div id="enhanced"  class="prog-buttons">
         <label> A in First
             C in First <!-- this should be fine (text after input) -->
         </label>
     </div>
+    
     <p>This set of buttons has the "B" option set as checked in the markup.</p>
     <div id="preset" class="prog-buttons">
         <label> A in Second
             <input type="radio" value="C" name="second" />
         </label>
     </div>
+    
     <p>Make some selections and submit the form to see what gets sent.</p>
     <input type="submit"/>
 </form>