Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is my jquery
- $(document).ready(function(){
- $(document).on('change','#select_promo',function(){
- var price = $('#show_promo_price').val($("#select_promo option:selected").attr('price'))
- var action = $('#show_promo_action').val($("#select_promo option:selected").attr('action'))
- var action_value = action.val();
- var price_value = price.val();
- $(document).on('click', '#promoBtn', function(e){
- var model = $('#show_promo_model').val($("#select_model option:selected").attr('value'))
- var model_value = model.val();
- console.log(action_value);
- console.log(price_value);
- });
- });
- });
- This is my HTML
- <div class="form-group">
- <label for="select_brand" class="col-sm-3 control-label">Brand Name</label>
- <div class="col-sm-9">
- <input type="hidden" class="form-control noBorder" id="show_promo_brand" name="show_promo_brand" readonly disabled>
- <select id="select_brand" name="select_brand" class="form-control" required>
- <option selected="" disabled="">Choose brand....</option>
- <?php
- $conn = $pdo->open();
- $getBrand = $conn->prepare("SELECT * FROM brand
- LEFT JOIN product_model ON brand.brand_id = product_model.brand_id
- LEFT JOIN backup_sales ON backup_sales.model_id = product_model.model_id
- WHERE backup_sales.po_ID = '".$_GET['po_ID']."'
- GROUP BY brand.brand_name");
- $getBrand->execute();
- $getRowsBrand = $getBrand->fetchAll();
- foreach($getRowsBrand as $brand)
- {
- echo "
- <option id='".$brand['brand_id']."' value='".$brand['brand_id']."'>".$brand['brand_name']."</option>
- ";
- }
- $pdo->close();
- ?>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label for="select_model" class="col-sm-3 control-label">Model Name</label>
- <div class="col-sm-9">
- <input type="hidden" class="form-control noBorder" id="show_promo_model" name="show_promo_model" readonly disabled>
- <select id="select_model" name="select_model" class="form-control" required>
- </select>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement