November 24, 2015

jQuery validation for price field.

Please follow example for set jquery validation for price field.

HTML
<input id="price" maxlength="7" type="text" />

Javascript
$("#price").on("keyup", function(){
    var valid = /^\d{0,4}(\.\d{0,2})?$/.test(this.value),
        val = this.value;
   
    if(!valid){
        console.log("Invalid input!");
        this.value = val.substring(0, val.length - 1);
    }
});

Enjoy!

OpenCart how to add new menu?



Follow the below step:

Log into your OpenCart administration panel like: domainname.com/admin.

Navigate to Catalog -> Information.

Click the Insert button to add a new content page.

And you can enter page name, description and all others fields.


Select the Data tab. Here you can define page keywords, set Sort Order...etc

Save it.

You need to edit the code of the header.tpl

The file is located in the /catalog/view/theme/yourtheme/template/common/header.tpl folder.

Enjoy!

November 6, 2015

About AngularJS.



Finally now I start work on AngularJS. I like this javascript Framework.

AngularJS is open source, completely free to used. For use of AngularJS you need just basic knowledge of javascript, Ajax and HTML.

Here I display basic example of AngularJS:

<!doctype html>
<html ng-app>
 
   <head>
      <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>
   </head>
 
   <body>
      <div>
         <label>My Name:</label>
         <input type = "text" ng-model = "MyName" placeholder = "Enter a name here">
         <hr />
       
         <h1>Hello {{MyName}}!</h1>
      </div>
     
   </body>
</html>

Enjoy!

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...