Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

..GBEST..

if submit retorna um alert

Recommended Posts

Bom,vou postar o script completo,pois peguei na net,e nao intendo nada de js,então vamos lá:

<form action="" method="post">
<table width="520" border="0" cellpadding="0" cellspacing="0" id="blog">
<tr><td height="5"></td></tr>
 <tr><td class="conecta" colspan="2" valign="top">
 						<a href="javascript:selTexto('descricao', '[b]', '[/b]');" title="Negrito"><img src="img/bbcode/bold.png" alt="Negrito" border="0"/></a>
                        <a href="javascript:selTexto('descricao', '[i]', '[/i]');" title="Itálico"><img src="img/bbcode/italic.png" alt="Itálico"border="0" /></a>
                        <a href="javascript:selTexto('descricao', '[u]', '[/u]');" title="Underline"><img src="img/bbcode/underline.png" alt="Underline" border="0"/></a>
                        <a href="javascript:selTexto('descricao', '[br]', '[/br]');" title="descer"><img src="img/bbcode/descer.png" alt="descer"border="0" /></a>
						<a href="javascript:selTexto('descricao', '[align=left]', '[/align]');" title="Alinhar a Esquerda"><img src="img/bbcode/left.png" alt="Esquerda"border="0" /></a>
                        <a href="javascript:selTexto('descricao', '[align=center]', '[/align]');" title="Alinhar ao Centro"><img src="img/bbcode/center.png" alt="Centralizar"border="0" /></a>
                        <a href="javascript:selTexto('descricao', '[align=right]', '[/align]');" title="Alinhar a Direita"><img src="img/bbcode/right.png" alt="Direita" border="0"/></a>
                        <a href="javascript:selTexto('descricao', '[align=justify]', '[/align]');" title="Texto Justificado"><img src="img/bbcode/justify.png" alt="Justificar" border="0"/></a>
                        <a href="javascript:selTexto('descricao', '[url]', '[/url]');" title="Inserir URL"><img src="img/bbcode/url.png" alt="URL"border="0" /></a>
                       </td>

   </tr>
 <tr>
   <td width="140" height="184" valign="top"><strong>Texto * </strong></td>
	<td colspan="2" valign="top"><textarea name="descricao" id="descricao" cols="55" rows="10" value="<?php echo $msg;?>"class="requerido" maxlength="200"></textarea></td>
    </tr>
function selecao(obj, def_texto_padrao){
    if(obj.constructor == String){obj = document.getElementById(obj);}
    var def_texto = (def_texto_padrao) ? function(text){obj.value += text;} : function(){return false;};
    var selecao = {text: "", defTexto: def_texto};
    if(document.selection){
        var faixa = document.selection.createRange();
        if(faixa.text){
            selecao.text = faixa.text;
            selecao.defTexto = function(text){
                faixa.text = text.replace(/\r?\n/g, "\r\n");
            }
    }
    } else if(typeof(obj.selectionStart) != "undefined"){
        selecao.text = obj.value.substring(obj.selectionStart, obj.selectionEnd);
        selecao.defTexto = function(text){
            obj.value = obj.value.substring(0, obj.selectionStart) + text + obj.value.substring(obj.selectionEnd);
            return false;
        }
    } else if(window.getSelection){
        selecao.text = window.getSelection().toString();
    }
    return selecao;
}

function selTexto(obj, antes, depois){
    var selecionado = selecao(obj, true);
    selecionado.defTexto(antes + selecionado.text + depois);
}

Quando eu dou submit enviando dados do campo descricao,

aparece um alert,com o conteudo do campo..

não sei o porque,

gostaria que alguem me ajudasse por favor.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.