function getPrint(print_area) { //Creating new page //alert("ole"); var pp = window.open(); //Adding HTML opening tag with … portion pp.document.writeln('Print Preview') pp.document.writeln('') pp.document.writeln('') pp.document.writeln('') //Adding Body Tag pp.document.writeln(''); //Adding form Tag pp.document.writeln('
'); //Creating two buttons Print and Close within a HTML table pp.document.writeln('
'); pp.document.writeln(''); pp.document.writeln(''); pp.document.writeln('
'); //Writing print area of the calling page pp.document.writeln(document.getElementById(print_area).innerHTML); //Ending Tag of
, and pp.document.writeln(''); } function LimpaTextBoxPesquisa(textBoxID) { if (document.getElementById(textBoxID).value == "Pesquisa...") { document.getElementById(textBoxID).value = ""; } } function AcrescentaTextBoxPesquisa(textBoxID) { if (document.getElementById(textBoxID).value == "") { document.getElementById(textBoxID).value = "Pesquisa..."; } } function IsNumeric(inputstr) { count = 0; pos = inputstr.indexOf(","); while ( pos !== -1 ) { count++; pos = inputstr.indexOf(",", pos + 1); } return (count <= 1); } function ValidaInput(myfield, e, TipoValidacao ) { /* ----- EXEMPLOS --------------------------------------------------- Inteiros return ValidaInput(this, event, 'Inteiros'); Decimais return ValidaInput(this, event, 'Decimais'); Alfanumericos return ValidaInput(this, event, 'Alfanumericos'); --------------------------------------------------------------------- */ //case "Decimais": ExpressaoRegular = /[0-9\,]/g; var ExpressaoRegular switch(TipoValidacao) { case "Inteiros": ExpressaoRegular = /[1234567890]/g; break; //case "Decimais": ExpressaoRegular = /\d{1,3}(\,\d{0,2})*/g; case "Decimais": ExpressaoRegular = /[0-9\,]+[0-9]*/g; //case "Decimais": ExpressaoRegular =/[0-9]+\,[0-9]{1,2}/g; break; case "Alfanumericos": ExpressaoRegular = /[A-Za-z]/g; break; case "Telefone": ExpressaoRegular = /[1234567890-]/g; break; } if (!e) var e = window.event if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; var character = String.fromCharCode(code); if (code == 27) { this.blur(); return false; } if (!e.ctrlKey && code != 9 && code != 8 && code != 36 && code != 37 && code != 38 && (code != 39 || (code == 39 && character == "'")) && code != 40) { if (character.match(ExpressaoRegular)) { if (TipoValidacao == "Decimais") { //if (checkdot == "checkdot") { //return !isNaN(myfield.value.toString() + character); return IsNumeric(myfield.value.toString() + character); } else { return true; } } else { return false; } } }