Jump to content

Recommended Posts

hi

i want create factor bootstrap form repeater i want when barcode field keyup send input value to javascript

 

but not work

   $('form input[name="group-product[1][barcode]"]').keyup(function(this) {

 

 

 

 

 

my code

<script type="text/javascript">
    
$(document).ready(function(){
    
    
    $('form input[name="group-product[1][barcode]"]').keyup(function(this) {
  
    $('form input[name="group-product[1][barcode]"]').each(function(){
        alert($('form input[name="group-product[1][barcode]"]').val())
    });
});
    
    
$('#cd2').keyup(function() {
    
    
    
 
    
    var mydata = $('form input[name="group-product[0][barcode]"]').val();
  
if(name=="")
{
$("#disp").html("");
}
else
{
$.ajax({
type: "POST",
url: "user_check.php",
    
    cache: false,
    
data: "name="+ mydata ,
success: function(html){

    
$("#disp").html(html);
    $("#disp1").html(int1);
}
});
return false;
}
});
});
</script>
                       
                       
                        <div class="row">
                            
                            <div class="col-md-12">
                                <div class="portlet light bordered">
                                    <div class="portlet-title">
                                        <div class="caption">
                                           
                                           
                                           <div id="disp"></div><br />
<div id="disp1" style="font-size: 12px;"></div><br />
                                           
                                           
                                            <i class="icon-speech font-green"></i>
                                            <span class="caption-subject bold font-green uppercase">
                                        <font style="font-family:iransans4_bold">
sale
                                                </font>    
                                       
                                       </span>
                                        </div>
                                        
                                    </div>
                                    <div class="portlet-body">
                                        <form role="form" id="frm1" method="get" action="user_check.php">
                                           
                                           <div class="row">
                                                                <div class="col-md-2">
                                                                    <div class="form-group">
                                                                        <label>
                                                                            <font style="font-family:iransans4_light">
date sale
                                                </font>    
                                                                        </label>
                   <input type="text" onkeypress="isNumberKey(event)" name="name[1]" class="form-control"> </div>
                                                                </div>
                                                                <!--/span-->
                                                                <div class="col-md-2">
                                                                    <div class="form-group">
                                                                        <label>
                                                                        <font style="font-family:iransans4_light">
cod factor
                                                </font>    
                                                                       </label>
                                                                        <input type="text" id="cd1" name="name[2]" class="form-control"> </div>
                                                                </div>
                                            </div>             
                                                                
                                            
                                            
    <div class="form-group mt-repeater">
       <div data-repeater-list="group-product">
          <div data-repeater-item class="mt-repeater-item">
              <div class="row mt-repeater-row">
                                                           
                 <div class="col-md-2">
                    <label class="control-label">
                    <font style="font-family:iransans4_light">
barcode
                     </font>    
                   </label>
                    <input type="text" id="cd2" name="barcode" placeholder="" class="form-control" />
                  </div>
                  <div class="col-md-4">
                     <label class="control-label">
                      <font style="font-family:iransans4_light">
name
                         </font>    
                    </label>
                     <input type="text" name="product_name" placeholder="" class="form-control" />
                  </div>
                  
                   <div class="col-md-1">
                     <label class="control-label">
                      <font style="font-family:iransans4_light">
                             number
                         </font>    
                    </label>
                     <input type="text" name="number" placeholder="" class="form-control" />
                  </div>
                  
                   <div class="col-md-2">
                     <label class="control-label">
                      <font style="font-family:iransans4_light">
price
                         </font>    
                    </label>
                     <input type="text" name="unit_price" placeholder="" class="form-control" />
                  </div>
                  
                   <div class="col-md-2">
                     <label class="control-label">
                      <font style="font-family:iransans4_light">
total
                         </font>    
                    </label>
                     <input type="text" name="total_price" placeholder="" class="form-control" />
                  </div>
                  
                  
                  <div class="col-md-1">
                     <a href="javascript:;" data-repeater-delete class="btn btn-danger mt-repeater-delete">
                        <i class="fa fa-close"></i>
                      </a>
                 </div>
           </div>
        </div>
     </div>
                                                <a href="javascript:;" data-repeater-create class="btn btn-info mt-repeater-add">
                                                    <i class="fa fa-plus"></i>
        <font style="font-family:iransans4_light">
add new line
                         </font>    
        </a>
  </div>
                                            
                                            <div class="row">
                                             <div class="col-md-3">
                                               <div class="form-group">
                                                <label class="control-label">
                                                <font style="font-family:iransans4_light">
total price
                         </font>    
                                               </label>
                                                <input type="text" name="total" placeholder="" class="form-control" />
                                                </div>
                                            </div>
                                            </div>
                                               
                                                
                                            <div class="margin-top-10">
                                                <a href="javascript:;" class="btn green">Save Changes </a>
                                                <a href="javascript:;" class="btn default">Cancel </a>
                                                <input type="submit" class="btn default" value="ok">
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- END CONTENT BODY -->
                </div>
                <!-- END CONTENT -->
 
            </div>
            <!-- END CONTAINER -->

sale_product_step1.php

Link to comment
https://forums.phpfreaks.com/topic/303295-form-repeater-in-bootstarp/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.