maplace.js – simple map with markers

Maplace.js is a library for google maps. This snippet

  • creates a map
  • creates 2 marker
  • applies some “style” to this map

https://github.com/danielemoraschi/maplace.js

 

Check if a form has changes before unload the page

Html:

Javascript:

 

Making a websites’s mega menu accessible for tablets and below

The goal is to allow click events on the first level for desktop browsers, and to trigger a hover event for mobile browsers.

How to detect a mobile browser? I chose this approach: http://stackoverflow.com/a/14301832/4074710

The mega menu:

The javascript:

Of course this is not THE perfect solution, but it works.

Oxid eShop: extend javascript validation

In this example, I add some new form validation features for  Oxid eShop. First, a regex validation method, then a required method for checkboxes (missing in Oxid CE).

Create a new file somewhere, and include it in your template.

The new features can be used within the template like the following examples.

The regex validation:

The notEmpty / required validation with the checkbox:

Form validation with javascript for Oxid

Folgende Schritte sind notwendig:

  • Einbinden von oxinputvalidator.js
  • <Form> mit  .oxValidate  versehen
  • <Input> mit .js-oxValidate  und anderen Validatoren versehen

Verfügbare Validatoren:

  • js-oxValidate
  • js-oxValidate_email
  • js-oxValidate_notEmpty
  • js-oxValidate_length
  • js-oxValidate_match
  • js-oxValidate_date

Passwort Länge:

Validierungs Nachrichten: