HTML5 Pattern for PAKISTAN Phone Number Format

2:48 PM 0



HTML5 Pattern for PAKISTAN Phone Number Format


<input type="text" pattern="03[0-9]{2}-(?!1234567)(?!1111111)(?!7654321)[0-9]{7}" name="mobile_number" placeholder="Mobile Number" required>

How to display all images of product in magento

2:42 PM 0

How to display all images of product in magento



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<?php 
    $_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
 ?>
<?php 
   if($_images){?>          
  <?php  $i=0; foreach($_images as $_image){ $i++;?>
  <a href="#">
    <img src="<?=$this->helper('catalog/image')->init($_product, 'image', $_image->getFile()); ?>"alt="<?=$this->htmlEscape($_image->getLabel());?>" title="<?=$this->htmlEscape($_image->getLabel());?>" />
   </a>             
<?php  } ?>
<?php  } ?>

How to get value form SELECT on click jQuery

2:28 PM 0




How to get value form SELECT on click jQuery
1
<select id="selected">


1
2
3
4
5
6
7
8
<script type="text/javascript">

    $(document).ready(function(){ 
        $('#selected').change(function(){
        alert($(this).val());                                                          

      });
 </script>

How to change bootstrap tooltip color

12:22 PM 0


How to change bootstrap tooltip color

For the arrow, first confirm that which direction you are using. For example, i am using left direction, then it should be



.tooltip .tooltip-inner {
    background-color:#2fa5fb;
}
.tooltip.left > .tooltip-arrow {
   border-left-color: #2fa5fb;
}

Magento 1.9 - TypeError: this.toggleElements.toggleSingle is not a function

12:08 PM 0

Magento 1.9 - TypeError: this.toggleElements.toggleSingle is not a function

Solution
The solution is simple, Just copy the below code.


  match: function () {
        if(this.toggleElements.length > 0){
            this.toggleElements.toggleSingle();
        }
    },
    unmatch: function () {
        if(this.toggleElements.length > 0){
            this.toggleElements.toggleSingle({destruct: true});
        }
    }