// (gH) -_- fa.js ; TimeStamp (unix) : 07 Mars 2013 vers 16:56
function ucFirst (str) { // # à ne pas confondre avec ucwords...
// http://kevin.vanzonneveld.net
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Onno Marsman
// + improved by: Brett Zamir (http://brett-zamir.me)
// * example 1: ucfirst('kevin van zonneveld');
// * returns 1: 'Kevin van zonneveld'
// ajout (gH) ; test sur la longueur de str
if (str.length==0) {
return str
} else {
str += '' ;
var f = str.charAt(0).toUpperCase();
return f + str.substr(1).toLowerCase() ;
} // fin si
} // fin de fonction ucFirst
// ##########################################################################
String.prototype.ucfirst = function () {
return ucFirst(this)
} // fin de fonction ucfirst
// ##########################################################################
function montreChamps(laTable) {
autreTable = "artistes" ;
if (laTable=="artistes") { autreTable = "films" }
window.document.getElementById("champs"+laTable.ucfirst()).setAttribute("class","visible")
window.document.getElementById("champs"+autreTable.ucfirst()).setAttribute("class","invisible")
window.document.getElementById("pcrit").setAttribute("class","visible")
window.document.getElementById("envoi").setAttribute("class","visible")
// pour transmettre à php le choix de la table
window.document.getElementById("nomtableChoix").value = laTable
} // fin de fonction montreChamps
|