How can use jquery to get the value of f_qty field and perform an action with each of the values ​​obtained? -


i new jquery / javascript , need help. have html form contains table "products" , need once user fill quantity field in records, user push button start scan table , execute action each of values ​​obtained. possible or asking ?? in advance.

    <div class="products" >     <table width="100%" cellspacing="0" cellpadding="0" border="0">     <thead>     <tr>      <th class="left">product</th>      <th>quantity</th>      <th>precio</th>      <th></th>      </tr>     </thead>     <tbody>      <tr>     <td class="left">product 1</a></td>     <td><input type="number" name="f_qty" min="1" max="9999" step="1" value="1"></td>    <td>35.17</td>     </tr>     <tr>      <td class="left">product 2</a></td>     <td>     <input type="number" name="f_qty" min="1" max="9999" step="1" value="1">     </td>     <td>18.48</td>     </tr>     <tr>    <td class="left">product 3</a></td>    <td>    <input type="number" name="f_qty" min="1" max="9999" step="1" value="1">    </td>    <td>4.00</td>    </tr>     <tr>     <td class="left">product 4</a></td>     <td>     <input type="number" name="f_qty" min="1" max="9999" step="1" value="1">     </td>     <td>14.20</td>     </tr>     </tbody>     </table>     </div> 

hi. have tried nothin happend, te value not shown on apex field

    <!doctype html public "-//w3c//dtd html 4.01//en"                 "http://www.w3.org/tr/html4/strict.dtd">     <html>     <head>     <meta http-equiv="content-type" content="text/html;charset=utf-8">     <title>jquery agregar unidades</title>     <script type="text/javascript">     $("#somebutton").click(       function(){         $("input[name=f_qty]").each(function(){            var valueincurrenttextbox = $(this).val(); //take action here            valueincurrenttextbox.add( 'p12_cantidad_pedido' , pthis.value);         });       }     );     </script>     </head>     <body>     <div id="default"></div>     <p style="clear: both;">     <button type="button" style="font-weight: bold; width: auto;"                         id="somebutton">agregar unidades</button><p><span class="demolabel"></span></p>     </body>     </html> 

$("#somebutton").click(   function(){     $("input[name=f_qty]").each(function(){        var valueincurrenttextbox = $(this).val(); //take action here     });   } ); 

try above. iterates through text boxes when button clicked


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -