I do not understand the question. :( Why are these scripts in separated file? Could you simply put them all in 1 file and then include it using src? The down side is that you would include other variable/data that will not be used in differen pages. Unless you pass a variable to specified which variable you want to be loaded...
//i.e.
var categorie = null
var subcategorie = null
var continut = null
function getValidator(validatorName) {
if (validatorName=="categorie") {
categorie = new Validator(validatorName)
categori.add(...)
}
else if (validatorName=="subcategorie") {
subcategorie = new Validator(validatorName)
subcategori.add(...)
}
else if (validatorName=="continut") {
continut = new Validator(validatorName)
continut.add(...)
}
}
But better yet, use the same variable name instead of 3 variables...
//i.e.
var categorie = null
function getValidator(validatorName) {
categorie = new Validator(validatorName)
if (validatorName=="categorie") {
categori.add("add_categorie","req","Va rugam sa va completati categoria")
}
else if (validatorName=="subcategorie") {
categori.add("add_subcategorie","req","Va rugam sa va completati subcategoria")
}
else if (validatorName=="continut") {
categori.add("add_continut","req","Va rugam sa va completati continutul")
}
}
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17