// -------------------- emptyCheck ------------------
// Joduba: 18/06/2004
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// --------------------------------------------------
// ca_ES
function emptyCheck(elementID) {
// checks if the field is empty
var filter = /^.*[A-Za-z0-9]\w*.*$/;
if (!filter.test(elementID.value)) {
alert("Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
};
function emptyCheckField(elementID,name) {
// checks if the field is empty
var filter = /^.*[A-Za-z0-9]\w*.*$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
};
function checkboxCheckField(elementID,name) {
if (!elementID.checked) {
alert ("El Checkbox és necessari per enviar aquest formulari");
elementID.focus();
return false;
}
return true;
}
// -------------------- nameCheck ------------------
// Joduba: 18/06/2004
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// --------------------------------------------------
function nameCheck(elementID) {
// checks if the field is empty
var filter = /^.*[A-Za-z]\w*.*$/;
if (!filter.test(elementID.value)) {
alert("Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
};
function nameCheckField(elementID,strName) {
if (elementID.value!="") return true;
else{
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
/*
// checks if the field is empty
var filter = /^.*[A-Za-z]\w*.*$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
*/
};
// -------------------- usernameCheck ------------------
// Joduba: 12/10/2004
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// --------------------------------------------------
function usernameCheck(elementID) {
// checks if the field is empty
var filter = /^[a-z0-9]+[a-z_.\-0-9]*[a-z0-9]+$/;
if (!filter.test(elementID.value)) {
alert("Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
};
function usernameCheckField(elementID,strName) {
if (elementID.value=="") {
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
// checks if the field is empty
var filter = /^[a-z0-9]+[a-z_.\-0-9]*[a-z0-9]+$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"Format no vàlid... Usa minúscules, números i caràcters com -_-, ---, -.- (guió, guió baix, punt...)\n"+strName+"ha de comencar amb una lletra i acabar amb una lletra o digit");
elementID.focus();
return false;
}
return true;
};
// -------------------- domainCheck ------------------
// Joduba: 31/10/2004
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// --------------------------------------------------
function domainCheck(elementID) {
// checks if the field is empty
var filter=/^((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (!filter.test(elementID.value)) {
alert("Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
};
function domainCheckField(elementID,strName) {
if (elementID.value=="") {
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
// checks if the field is empty
var filter=/^((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"Format no vàlid... Usa minúscules, números i caràcters com -_-, ---, -.- (guió, guió baix, punt...)\n"+strName+"ha de comencar amb una lletra i acabar amb una lletra o digit");
elementID.focus();
return false;
}
return true;
};
// -------------------- identifierCheck ------------------
// jmserra: 04/04/2007
// --------------------------------------------------
function identifierCheck(elementID) {
var filter = /^[a-zA-Z]+([a-zA-Z0-9]|[-]|[_])*$/;
if (!filter.test(elementID.value)) {
alert("Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
};
function identifierCheckField(elementID,strName, required) {
if (!required){
if (elementID.value=="") return true;
}
if (elementID.value=="") {
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
// checks if the field is empty
var filter = /^[a-zA-Z0-9]+([a-zA-Z0-9]|[-]|[_]|[@]|[.])*$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"S\'han trobat caràcters invàlids. Si us plau, utilitzi només lletres (sense accents), nombres, guions normals o baixos ( - o _ ) y punts\n"+strName+"ha de comencar amb una lletra i acabar amb una lletra o digit");
elementID.focus();
return false;
}
return true;
};
// -------------------- Comprovar si es email------------------
// Joduba: 03/02/2004
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
/*//Versio anterior
function emailCheck(elementID) {
// checks if the e-mail address is valid
//var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
var filter=/^([a-zA-Z0-9_.-+])+@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (!filter.test(elementID.value)) {
alert("El teu email sembla incorrecte. Torna a intentar-ho (comproba la \'@\' i \'.\'s a l\' adreça email)");
elementID.focus();
return false;
}
return true;
}
*/
//He trobat el seguent codi per inet, esta molt lograt
// Email Validation Javascript
// copyright 23rd March 2003, by Stephen Chapman, Felgall Pty Ltd
function emailCheck(elementID) {
addr=elementID.value;
//function validateEmail(addr,man,db) {
//Head anterior
man=1;//per defecte
db=1;//per defecte
if (addr == '' && man) {
alert("és obligatori indicar una adreça electrònica");
elementID.focus();
return false;
}
var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
for (i=0; i -1) {
alert("l\'adreça electrònica conté caràcters no vàlids");
elementID.focus();
return false;
}
}
for (i=0; i127) {
alert("l\'adreça electrònica conté caràcters que no són ascii (de l\'anglès American Standard Code for Information Interchange, un stàndar, de fet, internacional)");
elementID.focus();
return false;
}
}
var atPos = addr.indexOf('@',0);
if (atPos == -1) {
alert("L\'adreça electrònica ha de contenir una @");
elementID.focus();
return false;
}
if (atPos == 0) {
alert("L\'adreça electrònica no ha de començar amb @");
elementID.focus();
return false;
}
if (addr.indexOf('@', atPos + 1) > - 1) {
alert("una adreça electrònica només pot tenir UNA @");
elementID.focus();
return false;
}
if (addr.indexOf('.', atPos) == -1) {
alert("L\'adreça electrònica ha de contenir un punt després de @xxx (el nom del domini)");
elementID.focus();
return false;
}
if (addr.indexOf('@.',0) != -1) {
alert("Un punt no pot seguir a @ en l\'adreça electrònica");
elementID.focus();
return false;
}
if (addr.indexOf('.@',0) != -1){
alert("un punt no pot estar abans de la @ en una adreça electrònica");
elementID.focus();
return false;
}
if (addr.indexOf('..',0) != -1) {
alert("2 punts no es poden adjuntar a una adreça electrònica");
elementID.focus();
return false;
}
// do not check TLD as there are too many TLDs.
return true;
}
function noRequiredEmailCheck(elementID) {
// Check if empty
if (elementID.value=="") return true;
// checks if the e-mail address is valid
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (!filter.test(elementID.value)) {
alert("El teu email sembla incorrecte. Torna a intentar-ho (comproba la \'@\' i \'.\'s a l\' adreça email)");
elementID.focus();
return false;
}
return true;
}
// -------------------- Password Generator ------------------
// Joduba: 04/09/2004
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
// -- Original: Rob Kroll (rkroll@istar.ca)
function pwgen(l) {
if (l<6) l=6;
var i;
var tmpstr;
var selectionUppercase=new Array(26)
var ulength=26;
selectionUppercase[1]="A"; selectionUppercase[2]="B"; selectionUppercase[3]="C"; selectionUppercase[4]="D";
selectionUppercase[5]="E"; selectionUppercase[6]="F"; selectionUppercase[7]="G"; selectionUppercase[8]="H";
selectionUppercase[9]="I"; selectionUppercase[10]="J"; selectionUppercase[11]="K"; selectionUppercase[12]="L";
selectionUppercase[13]="M"; selectionUppercase[14]="N"; selectionUppercase[15]="O"; selectionUppercase[16]="P";
selectionUppercase[17]="Q"; selectionUppercase[18]="R"; selectionUppercase[19]="S"; selectionUppercase[20]="T";
selectionUppercase[21]="U"; selectionUppercase[22]="V"; selectionUppercase[23]="W"; selectionUppercase[24]="X";
selectionUppercase[25]="Y"; selectionUppercase[26]="Z";
var selectionNumber=new Array(10)
var nlength=10;
selectionNumber[1]="0"; selectionNumber[2]="1";
selectionNumber[3]="2"; selectionNumber[4]="3"; selectionNumber[5]="4"; selectionNumber[6]="5";
selectionNumber[7]="6"; selectionNumber[8]="7"; selectionNumber[9]="8"; selectionNumber[10]="9";
var selectionLowercase=new Array(26)
var llength=26;
selectionLowercase[1]="a"; selectionLowercase[2]="b"; selectionLowercase[3]="c"; selectionLowercase[4]="d";
selectionLowercase[5]="e"; selectionLowercase[6]="f"; selectionLowercase[7]="g"; selectionLowercase[8]="h";
selectionLowercase[9]="i"; selectionLowercase[10]="j"; selectionLowercase[11]="k"; selectionLowercase[12]="l";
selectionLowercase[13]="m"; selectionLowercase[14]="n"; selectionLowercase[15]="o"; selectionLowercase[16]="p";
selectionLowercase[17]="q"; selectionLowercase[18]="r"; selectionLowercase[19]="s"; selectionLowercase[20]="t";
selectionLowercase[21]="u"; selectionLowercase[22]="v"; selectionLowercase[23]="w"; selectionLowercase[24]="x";
selectionLowercase[25]="y"; selectionLowercase[26]="z";
var selectionSymbol=new Array(8)
var slength=8;
selectionSymbol[1]="%"; selectionSymbol[2]="+";
selectionSymbol[3]="_"; selectionSymbol[4]="-"; selectionSymbol[5]="=";
selectionSymbol[6]="?"; selectionSymbol[7]="*"; selectionSymbol[8]="#";
var o=new Array(l)
i=0;
// Select 2 symobols
do {
var randscript = -1;
while (randscript < 1 || randscript > slength || isNaN(randscript)) {
randscript = parseInt(Math.random()*(slength));
}
o[i]=selectionSymbol[randscript];
i=i+1;
} while (i<2);
// Select 2 Numbers
do {
var randscript = -1;
while (randscript < 1 || randscript > nlength || isNaN(randscript)) {
randscript = parseInt(Math.random()*(nlength));
}
o[i]=selectionNumber[randscript];
i=i+1;
} while (i<4);
// Uppercase = remaining / 2
var r;
r=4+parseInt((l-4)/2);
do {
var randscript = -1;
while (randscript < 1 || randscript > ulength || isNaN(randscript)) {
randscript = parseInt(Math.random()*(ulength));
}
o[i]=selectionUppercase[randscript];
i=i+1;
} while (i llength || isNaN(randscript)) {
randscript = parseInt(Math.random()*(llength));
}
o[i]=selectionLowercase[randscript];
i=i+1;
} while (i li passem un nou parametre, required, per validar si es correcte el mail introduit
//en cas que no sigui requerit
function checkNewPw(elementIDpw1,elementIDpw2,required) {
if(!required){
if (elementIDpw1.value=="" && elementIDpw1.value==elementIDpw2.value) return true;
}
if (elementIDpw1.value=="") {
alert ("La capsa de password no pot estar buida. Si us plau entra el password");
elementIDpw1.focus();
return false;
}
if (elementIDpw1.value != elementIDpw2.value) {
alert ("No has entrat dos cops la mateixa contrasenya nova");
elementIDpw1.focus();
return false;
}
if (elementIDpw1.value.length<8) {
alert ("La contrasenya ha de tenir al menys 6 caràcters");
elementIDpw1.focus();
return false;
}
if ( !( elementIDpw1.value.match(/[A-Z]/) ) ) {
alert ("Password must have at least 1 Uppercase letter.");
elementIDpw1.focus();
return false;
}
if ( !( elementIDpw1.value.match(/[0-9]/) ) ) {
alert ("Password must have at least 1 number.");
elementIDpw1.focus();
return false;
}
// Symobols on pwgen %+_-?*#=
if ( !( elementIDpw1.value.match(/[%+_\-?*#=]/) ) ) {
alert ("Password must have at least 1 Symbol.(%+_-?*#=)");
elementIDpw1.focus();
return false;
}
//Not allowed chars
if ( ( elementIDpw1.value.match(/[ºª$\"\']/) ) ) {
alert ("Password contains non allowed symbols.");
elementIDpw1.focus();
return false;
}
return true;
}
// To generate an scrolling news text
function IwithScroll_start() {
var IwithScrollIdSupported = false;
IwithScrollId_WIDTH = document.getElementById(IwithScrollId).style.width;
var img = "
";
if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
document.getElementById(IwithScrollId).innerHTML = "";
IwithScrollIdSupported = true;
}
if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
document.getElementById(IwithScrollId).innerHTML = ""+img+""+img+"
";
IwithScrollIdSupported = true;
}
if(!IwithScrollIdSupported) document.getElementById(IwithScrollId).outerHTML = ""; else {
document.getElementById(IwithScrollId).scrollLeft = IwithScrollDirection ? document.getElementById(IwithScrollId).scrollWidth - document.getElementById(IwithScrollId).offsetWidth : 0;
document.getElementById(IwithScrollId+"-iwspace").innerHTML = IwithScrollContent;
document.getElementById(IwithScrollId).style.display="block";
IwithScroll_do();
}
}
function IwithScroll_do() {
if(!IwithScrollPause) document.getElementById(IwithScrollId).scrollLeft += IwithScrollSpeed * (IwithScrollDirection ? -1 : 1);
if(IwithScrollDirection && document.getElementById(IwithScrollId).scrollLeft <= 0) document.getElementById(IwithScrollId).scrollLeft = document.getElementById(IwithScrollId).scrollWidth - document.getElementById(IwithScrollId).offsetWidth;
if(!IwithScrollDirection && document.getElementById(IwithScrollId).scrollLeft >= document.getElementById(IwithScrollId).scrollWidth - document.getElementById(IwithScrollId).offsetWidth) document.getElementById(IwithScrollId).scrollLeft = 0;
window.setTimeout("IwithScroll_do()", 30);
}
// -------------------- Comprovar si es Phone number------------------
// Markus: 15/07/2006
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function phoneCheckField(elementID,strName,required) {
// checks if the phone number is valid
if (!required){
if (elementID.value=="") return true;
}
var filter=/^\+?(\d|\w|-|.)*\d$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"El teu numero de telèfon sembla incorrecte. Intenta-ho un altre cop utilitzant \'+\',\'.\',\'-\',\'numeros\' ");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si es Number------------------
// Markus: 15/07/2006
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function numberCheckField(elementID,strName,required) {
// checks if the number is valid
if (!required){
if (elementID.value=="") return true;
}
//antes ->> ^\d(\d|'|,|.|e|E|\+|-)*\d$
var filter=/^(-)*\d(\d|\,|\'|\.)*(e|\�)?$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"El nombre sembla incorrecte.");
elementID.focus();
return false;
}
return true;
}
// --- Comprovar si es REALNumber---
// jsmerra: 21/05/2007
// ---------------------------------
function realnumberCheckField(elementID,strName,required) {
if (!required){
if (elementID.value=="") return true;
}
var filter=/^(\d|'|,|.|e|E|\+|-)*\d$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"El nombre sembla incorrecte.");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si es NumberRange------------------
// Markus: 15/07/2006
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function numberrangeCheckField(elementID,min,max,strName,required) {
// checks if the numberrange is valid, min<=elementID.value or elementID.value<=max
if (!required){
if (elementID.value=="") return true;
}
if (!(min<=elementID.value && elementID.value<=max)){
alert("Camp"+": "+strName+", "+"la gamma és"+": ["+min+"-"+max+"]\n"+"El nombre sembla incorrecte.");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si Integer------------------
// Markus: 15/07/2006
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function integerCheckField(elementID,strName,required) {
// checks if the integer is valid
if (!required){
if (elementID.value=="") return true;
}
var filter=/^(\d)*\d$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"El nombre sembla incorrecte");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si Decimal------------------
// Markus: 15/07/2006
//
// Original from: http://www.jsmadeeasy.com/
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function decimalCheckField(elementID,strName,required) {
// checks if the integer is valid
if (!required){
if (elementID.value=="") return true;
}
//nomenclatura UE -> decimal (,|')
//USA -> decimal (.)
var filter=/^(\d)*('|,|.)(\d)*\d$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"Els decimals semblen incorrectes");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si URL ------------------
// Markus: 15/07/2006
//
// Original from: http://www.webbedwonder.com
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function urlCheckField(elementID,strName,required){
if (!required){
if (elementID.value=="") return true;
}
// Know bug, doesn't accept URLs without www or other starting word, has to have at leat 3
var filter=/^((http(s)?|ftp):(\d)*\/\/)?([\%\_\-\+a-z0-9]*)\.(\w*)/;
var filter_relatives=/^\//;
if (!filter.test(elementID.value) && !filter_relatives.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"L\'adreça web -url- sembla incorrecta.");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si la hora es correcte-----
// Markus: 16/07/2006
//
// Original from: my mind, juasjuas
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function check_time_h(elementID,strName,required){
if(!required){
if (elementID.value=="") return true;
}
if (elementID.value==""){
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
if (!(0<=elementID.value && elementID.value<=23)){
alert("Camp"+": "+strName+"\n"+"La hora sembla incorrecta");
elementID.focus();
return false;
}
return true;
}
function check_time_m(elementID,strName,required){
if(!required){
if (elementID.value=="") return true;
}
if (elementID.value==""){
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
if (!(0<=elementID.value && elementID.value<=59)){
alert("Camp"+": "+strName+"\n"+"La hora (els minuts) sembla incorrecta");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si la data es correcte-----
// Markus: 16/07/2006
//
// Original from: my mind, juasjuas
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function dateCheckField(elementID, strName,required){
if(!required){
if (elementID.value=="") return true;
}
var filter=/^\d{2,4}(\-|\/)\d{2}\1\d{2,4}$/;
if (!filter.test(elementID.value)) {
alert("Camp"+": "+strName+"\n"+"La data sembla incorrecta.");
elementID.focus();
return false;
}
return true;
}
// -------------------- Comprovar si la data es correcte-----
// Markus: 16/07/2006
//
// Original from: my mind, juasjuas
// Tested on IE6, Mozilla Firebird.
// ----------------------------------------------------------
function emptyTextCheck(elementID,strName) {
// Check if empty
if (elementID.value==""){
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
}
function optionCheck(elementID,strName){
//elementID.value ens dona el valor de la key selected.
if (elementID.value==""){
alert("Camp"+": "+strName+"\n"+"Sisplau omple els camps obligatoris");
elementID.focus();
return false;
}
return true;
}
//------------------------------------------------
// toogleDiv: Hide and make visible a given division
// author: Joduba
// date: 15/07/2006
//--------------------------------------------------
function iwith_toggleDiv(divId, iconId, headerId, collapse, expand)
{
if (collapse==undefined ) collapse="Fes click aquí per reduir aquesta secció";
if (expand==undefined ) expand="Fes click aquí per expandir aquesta secció";
divElement = document.getElementById(divId);
imgElement = document.getElementById(iconId);
headerElement = document.getElementById(headerId);
if (divElement.nextSibling.style.display != "none") {
divElement.nextSibling.style.display = "none";
if (imgElement.src == null || imgElement.src ===undefined ) {
imgElement.className = "fa fa-arrow-circle-right";
} else {
imgElement.src="/i-images/cadi/collapserright.png";
imgElement.title=expand;
}
headerElement.title=expand;
}
else {
divElement.nextSibling.style.display = "block";
if (imgElement.src == null || imgElement.src ===undefined ) {
imgElement.className = "fa fa-arrow-circle-down";
} else {
imgElement.src="/i-images/cadi/collapserdown.png";
imgElement.title=expand;
}
headerElement.title=collapse;
}
}
//------------------------------------------------
// Form functions, tools to work in forms.
// author: Joduba
// date: 24/12/2007
//--------------------------------------------------
function iwith_form_select_SwapOptions(optionsArray, select_to_change_id, index)
{
the_array=optionsArray[index];
if (!the_array) return;
cselect=document.getElementById(select_to_change_id);
iwith_form_select_setOptionText(cselect, the_array);
}
function iwith_form_select_setOptionText(the_select, the_array)
{
for (loop=the_select.length; loop>0 ; loop--)
{
the_select.options[loop-1]=null;
}
for (var key in the_array)
{
var newOpt = new Option(the_array[key],key);
the_select.options[the_select.length]=newOpt;
}
}
function iwith_form_select_selectOption(selectid,myOption) {
select=document.getElementById(selectid);
for(i=0;imaxlen){
alert("Camp"+": "+strName+"\n"+"Té un tamany màxim de: "+maxlen);
elem.focus();
return false;
}
else{return true;}
}