Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/07/2008, 14:25
Avatar de KATICA
KATICA
 
Fecha de Ingreso: marzo-2008
Mensajes: 82
Antigüedad: 16 años, 2 meses
Puntos: 0
Respuesta: Cambiar la primera ne mayuscula???

amigos ya encontre la solucion voy a dejarla por si alguien la necesita ....la funcion .js me quedo asi
Código PHP:
function Convertir2(n)
{
texto=n.value+" ";
texto=texto.toLowerCase();
texto1="";
punc=",.?!:;)'";
punc+='"';
while ((
texto.length>0)&&(texto.indexOf(" ")>-1))
    {
    
pos=texto.indexOf(" ");
    
wrd=texto.substring(0,pos);
    
wrdpre="";
        if (
punc.indexOf(wrd.substring(0,1))>-1)
        {
        
wrdpre=wrd.substring(0,1);
        
wrd=wrd.substring(1,wrd.length);
        }
        
cmp=" "+wrd+" ";
        for (var 
i=0;i<9;i++)
        {
        
p=wrd.indexOf(punc.substring(i,i+1));
            if (
p==wrd.length-1)
            {
            
cmp=" "+wrd.substring(0,wrd.length-1)+" ";
            
i=9;
            }
        }
    if (
cmp.indexOf(cmp)<0)
    {
    
ltr=wrd.substring(0,1);
    
ltr=ltr.toUpperCase();
    
wrd=ltr+wrd.substring(1,wrd.length);
    }
    
texto1+=wrdpre+wrd+" ";
    
texto=texto.substring((pos+1),texto.length);
    }
ltr=texto1.substring(0,1);
ltr=ltr.toUpperCase();
texto1=ltr+texto1.substring(1,texto1.length-1);
n.value=texto1;

a mi me funciono perfectamente