

Form
#16
Posted 22/05/2006, 18:21


#17
Posted 23/05/2006, 07:44
include("http://www.bentoquirino.com.br/formatacao/func_bbcode.php"); echo"<font style='font-size: 13px;'><b>$titulo</b></font><br><font style='font-size: 9px;'>$data</font><br><br> $texto";Não é usando a função bbcode..
Você confirma isto?

Flws...

#18
Posted 23/05/2006, 10:06
Consegui (num lembro mais onde) adaptar este script pra mim:
1) No cabeçalho (entre as tags <head></head>), coloque
<script>
estadoBotaoNegrito = "fechado_b";
function Negrito() {
sel_b = document.selection;
if(sel_b.type == "Text"){
rng_b = sel_b.createRange();
rng_b.text = "<b>"+ rng_b.text +"</b>";
}else if(sel_b.type == "None"){
if(estadoBotaoNegrito == "aberto_b"){
document.forms['Formulario'].elements['texto'].value += "</b>";
estadoBotaoNegrito = "fechado_b";
tagAberta_b--;
}else if(estadoBotaoNegrito == "fechado_b"){
document.forms['Formulario'].elements['texto'].value += "<b>";
estadoBotaoNegrito = "aberto_b";
tagAberta_b++;
}
}
}
estadoBotaoItalico = "fechado_b";
function Italico() {
sel_b = document.selection;
if(sel_b.type == "Text"){
rng_b = sel_b.createRange();
rng_b.text = "<i>"+ rng_b.text +"</i>";
}else if(sel_b.type == "None"){
if(estadoBotaoItalico == "aberto_b"){
document.forms['Formulario'].elements['texto'].value += "</i>";
estadoBotaoItalico = "fechado_b";
tagAberta_b--;
}else if(estadoBotaoItalico == "fechado_b"){
document.forms['Formulario'].elements['texto'].value += "<i>";
estadoBotaoItalico = "aberto_b";
tagAberta_b++;
}
}
}
</script>
2) No form, coloque:
<form name="Formulario" action="pagina.php" method="post">
Título:<br><input name="titulo" type=text style="width:400px;" size="255" maxlength="255"><br><br>
Texto:<br>
<input type="button" value=" N " onclick="Negrito();" style="font-family: Tahoma; font-size: 8 pt; color: #808080; font-weight: bold; background-color: #F5F5F5; border: 1 solid #C0C0C0">
<input type="button" value=" I " onclick="Italico();" style="font-family: Tahoma; font-size: 8 pt; color: #808080; background-color: #F5F5F5; font-style: italic; border: 1 solid #C0C0C0">
<br>
<textarea id="texto" name="texto" rows="10" cols="50"></textarea><br><br>
<br><br><input type=submit value="Cadastrar Notícia">
</form>
Espero ter ajudado!
Abraços, t+
Não sou expert... mas tento ajudar! Mas o que mais preciso é de ajuda! hehehe
#19
Posted 03/10/2006, 12:14
Edição feita por: gnuclear, 03/10/2006, 12:47.
#20
Posted 03/10/2006, 13:58
<input type="image" src="bbcode/negrito.gif" />
Flws...

1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)