Domanda

I am trying to setup field masks for my HTML form, and am going with IMask

Step one was quite simple - upload the Java scripts to my server and then add

<script type="text/javascript" src="js/mootools.js"></script>  
    <script type="text/javascript" src="js/imask.js"></script>

to my forms head. The next step however I am completely lost on what to do with.

But here is where I need your help please.

Initialize the iMask class:

view plainprint?
new iMask({  
    onFocus: function(obj) {  
        obj.setStyles({"background-color":"#ff8", border:"1px solid #880"});  
    },  

    onBlur: function(obj) {  
        obj.setStyles({"background-color":"#fff", border:"1px solid #ccc"});  
    },  

    onValid: function(event, obj) {  
        obj.setStyles({"background-color":"#8f8", border:"1px solid #080"});  
    },  

    onInvalid: function(event, obj) {  
        if(!event.shift) {  
            obj.setStyles({"background-color":"#f88", border:"1px solid #800"});  
        }  
    }  
});  

Where to place this code?

È stato utile?

Soluzione

I believe that code is to go at the bottom of the page in between <script></script> tags.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top