Post by MrConn » Wed Apr 14, 2010 12:41 am

The Norwegian postalservice has got a great little app that I would like to implant into my opencart-installation...

This code automatically fills out City based on the postalcode (Norwegian only!)

Code: Select all

<script src=""></script>

<script type="text/javascript">
   $(document).ready(function() {
      inputField = $('#postnummerInput');
      outputElement = $('#postnummerResult');
      inputField.keyup(function() {
         if (inputField.val().length == 4) {
            $.getJSON(''+ inputField.val() +'&callback=?',
         else {
   <input type="text" id="postnummerInput" style="width: 4em;"/>  <span id="postnummerResult"> </span>
The code can be seen here
But as you can see the code only gives the city ("postnummerResult") out as a span... How can I get the output in a text-field?
Last edited by i2Paq on Wed Apr 14, 2010 4:48 pm, edited 1 time in total.
Reason: No bumping without new info.

Image - Billige Gadgets!

Active Member


Tue Mar 23, 2010 8:08 am
Who is online

Users browsing this forum: No registered users and 10 guests