Ir para conteúdo

POWERED BY:

Arquivado

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

Juliano Gomes

WordPress

Recommended Posts

Caros colegas estou precisando fazer algo parecido com a imagem em anexo, que também é parecido com essa tela que estou digitando o novo tópico, onde o usuário pode digitar e formatar texto, incluir links e imagens... só que em asp

 

alguem teria alguma idéia de como eu poderia fazer isso?

 

abraços a todos!

 

Imagem Postada

Compartilhar este post


Link para o post
Compartilhar em outros sites

existem varios, tipos de editores, o FCKeditor é um dos mais usados...

olha este exemplo simples e funcional:

 

test.asp

<%@language="vbscript"%>
<%

Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>

<!--#include file="etjs.asp"-->

<%dim mode,aspenab,formenab,cadreenab,lecontenu
aspenab="true"
cadreenab="true"
formenab="true"
lecontenu=""

mode=request.querystring("mode")
if mode="preview" then
response.write request.form("texte")
else
%>
<form name="formulaire" action=test.asp?mode=preview target=_blank method=post>
<!--#include file="tableaubouton.asp"-->
</form>
<%end if%>
</html>

tableaubouton.asp

 <table width="630" border="2" align="center" cellpadding="0" cellspacing="0">
 <tr> 
 <td bgcolor=#446DA5>
   
	 <div align="center"><font size="1">
	   <!-- / FORMATAGE -->
	   <A Href="java script:fhtml()"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif">Corpo HTML</font></A>	 
	   <font face="Verdana, Arial, Helvetica, sans-serif">  |  
		<A Href="java script:format('b')"><font color="#ffffff"><b>Negrito</b></font></A>   |  
		<A Href="java script:format('i')"><font color="#ffffff"><i>Italico</i></font></A>   |  
		<A Href="java script:format('u')"><font color="#ffffff"><u>Sublinhado</u></font></A>   |  
		<A Href="java script:format('big')"><font color="#ffffff"><Big>Big</Big></font></A>   |  
		<A Href="java script:format('xmp')"><font color="#ffffff">XMP</font></A>   |  
		<A Href="java script:pmtaille()"><font color="#ffffff">Titulo Texto</font></A>   |  
		<A Href="java script:pmcolor()"><font color="yellow">Cor</font></A>   |  
		<A Href="java script:ftitre()"><font color="#ffffff">Titulo</font></A>   |  
		<A Href="java script:format('center')"><font color="#ffffff">Centro</font></A>	 
		<!-- / FORMATAGE -->
		<br>
		<!-- PAGE -->
		<A Href="java script:format('blockquote')"><font color="#99FF00">blockquote</font></A>   |  
		<A Href="java script:balisesf('br')"><font color="#99FF00"><br></font></A>   |  
		<A Href="java script:fhr()"><font color="#99FF00">Linha horizontal</font></A>   |  
		<A Href="java script:lien()"><font color="#99FF00">Linha</font></A>   |  
		<A Href="java script:mailto()"><font color="#99FF00">Mailto</font></A>   |  
		<A Href="java script:fancre()"><font color="#99FF00">Âncora</font></A>   |  
		 
		<A Href="java script:ftable()"><font color="#99FF00">Tabela 2x2</font></A>   |  
		<A Href="java script:limage()"><font color="#99FF00">Imagem</font></A>   |  
		<a href="http://xibios.free.fr/french/doc/xallwrite/Keyboard.html" target=_blank><font color="#99FF00">©</font></a>   |  
		<A Href="java script:ul()"><font color="#99FF00">Lista com números</font></A>   |  
		<A Href="java script:ol()"><font color="#99FF00">Liste com marcadores</font></A>	
		<!-- /PAGE -->
		<br>
		<!-- ASP -->
		<% If aspenab="true" then %>
    |  
		<A Href="java script:asp()"><font color="pink">ASP</font></A>   |  
		<A Href="java script:asp1()"><font color="pink">Delimitador Asp</font></A>   |  
		<A Href="java script:asp2()"><font color="pink"><%=%></font></A>   |  
		<A Href="java script:fconn()"><font color="pink">Connexão ASP</font></A>   |  
		<A Href="java script:comm()"><font color="pink"><%'%></font></A>   |  
		<A Href="java script:ajou()"><font color="pink">SQL Insert</font></A>   |  
		<A Href="java script:del()"><font color="pink">SQL Delete</font></A>   |  
		<A Href="java script:mod()"><font color="pink">SQL Update</font></A>	
		 
		 
		<br>
		<% End If %>
		<!-- /ASP -->
		<!-- / FORM -->
		<% If formenab="true" then %>
		<A Href="java script:fform()"><font color="#663333"><b>Formulario</b></font></A>   |  
		<A Href="java script:fselect()"><font color="#663333"><b>select name</b></font></A>   |  
		<A Href="java script:fbouton()"><font color="#663333"><b>Botão</b></font></A>   |  
		<A Href="java script:fsoumettre()"><font color="#663333"><b>Botão Submit</b></font></A>   |  
		<A Href="java script:fcb()"><font color="#663333"><b>Checkbox </b></font></A>   |  
		<A Href="java script:fradio()"><font color="#663333"><b>Botão Radio</b></font></A>   |  
		<A Href="java script:fmopa()"><font color="#663333"><b>Senha</b></font></A>   |  
		<A Href="java script:ftext()"><font color="#663333"><b>Campo Texto</b></font></A>   |  
		<A Href="java script:fhidden()"><font color="#663333"><b>Campo Hidden</b></font></A>   |  
		<A Href="java script:ftextarea()"><font color="#663333"><b>Textarea</b></font></A> 
		<% End If %>
		<!-- / FORM -->
		 
		<% If cadreenab="true" then %>
		<br> 
		<!-- CADRE -->
    |  
		<A Href="java script:cadreT()"><font color="#663333"><b>FRAMESET ROWS e COLS</b></font></A>   |  
		<A Href="java script:cadreGD()"><font color="#663333"><b>FRAMESET COLS</b></font></A>   |  
		<A Href="java script:cadreHB()"><font color="#663333"><b>FRAMESET ROWS</b></font></A>   |  
		<% End If %>
		<!-- / CADRE --> 
		<!-- AIDE -->
		<br clear="all" />
		<!-- COPIER COLLER -->
		<a href="java script:document.formulaire.texte.select();"><font color="#ffffff"><b>Selecionar Tudo</b></font></a>   |  
		<A Href="java script:efface()"><font color="#ffffff"><b>Apagar</b></font></A>   | </font> 
	   <input type="submit" value="Visualizar Código">
	   
	   <!--/ COPIER COLLER -->
	 </font> </div></td>
 </tr> 
 <tr>
 <td><div align="center">
   <textarea cols="90" rows="20" name="texte"><%= lecontenu %></textarea>
 </div></td>
 </tr>
</table>

etjs.asp

<% if instr(1,Request.ServerVariables("HTTP_USER_AGENT"),"windows",1)>0 then  %>

<script language="JavaScript1.2">
<!-- hide


function fancre() {
var str = document.selection.createRange().text;
document.formulaire.texte.focus();
var sel = document.selection.createRange();
var letit = prompt("Link","");
sel.text =str + "\n<a name=" + letit + ">"+ "\n";
} 



function ftitre() {
var str = document.selection.createRange().text;
document.formulaire.texte.focus();
var sel = document.selection.createRange();
var letit = prompt("Nivel de 1 à 6","1");
sel.text =str + "\n<h" + letit + ">"+  "</h" + letit + ">" + "\n";
} 

function valide() {
  document.reel.contenu.value=document.formulaire.texte.value
  document.reel.submit()
}

function fhr() {
var str = document.selection.createRange().text;
document.formulaire.texte.focus();
var hor = prompt("Largura en pixel ou % ","300");
var haut = prompt("Altura en pixel ","1");
var sel = document.selection.createRange();
sel.text = str +"\n<hr size=" + haut+ " width="+hor +">"+  "\n";
} 


function format(f) {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<" + f + ">" + str + "</" + f + ">\n";
  return;
}


function balisesf(f) {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<" + f + ">" + str +"\n";
  return;
}
function lien() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("URL:","http://");
  var tar= prompt("Cible (target) :","");
  if (lien != null) {
	var sel = document.selection.createRange();
   sel.text = "<a href=\"" + lien  +'"'+ " target=" + tar +'"'+ "\">" + str + "</a>\n";
  }
  return;
} 
function pmcolor() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("Entre com a cor: nome ou  código","");
  if (lien != null) {
	var sel = document.selection.createRange();
   sel.text = "<font color=\"" + lien + "\">" + str + "</font>\n";
  }
  return;
} 
function limage() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lim = prompt("URL de imagem:","");
  if (lim != null) {
	var sel = document.selection.createRange();
 sel.text = "<img src=\"" + lim + "\"" + ">" +str+"\n";
   }
  return;
} 
function ftable(f) {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<table border=2>\n<tr>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n</tr>\n</table>"  + str+"\n";
  return;
}
function mailto() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("Email:","");
  if (lien != null) {
	var sel = document.selection.createRange();
   sel.text = "<a href=mailto:\"" + lien + "\">" + str + "</a>\n";
  }
  return;
} 
function fhtml() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<html>\n<head>\n<title></title>\n</head>\n<body>\n\n\n</body>\n</html>\n"  + str+"\n";
  return;
}
function asp() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<"+"%@ Language=VBScript %>" + str+"\n";
  return;
}
function asp1() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
   sel.text = "<"+"%"  + str + "%>\n";
  }
  return;
} 
function asp2() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
   sel.text = "<"+"%="  + str + "%>\n";
  }
  return;
} 
function fconn() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<"+"%Dim rs,sql,conn\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\n"+"Set rs= Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\n"+"Conn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")"   +"\nsql ="+'"'+"SELECT * FROM table1"+'"\n'+ "rs.Open sql, conn , 2, 3 \n"+"conn.execute(sql)\ndo while not rs.eof\n" +"response.write rs.fields("+'"'+"field1"+'"'+").value"+"\nrs.movenext\nloop\nrs.Close\nSet rs = Nothing\nConn.Close\nSet Conn = Nothing\n"+ str + "\n%>\n";
}
  return;
} 


function comm() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
   sel.text = "<"+"%'"  + str + "%>\n";
  }
  return;
} 
function pmtaille() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("Titulo do texto:","");
  if (lien != null) {
	var sel = document.selection.createRange();
   sel.text = "<font size=\"" + lien + "\">" + str + "</font>\n";
  }
  return;
} 

function ajou() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<"+"% dim c1,c2\nc1=request.form("+'"'+"c1"+'"'+")\nc1=replace(c1,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nc2=request.form("+'"'+"c2"+'"'+")\nc2=replace(c2,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\ndim sql\nSQL = "+'"'+"INSERT INTO table1(c1,c2)VALUES ('"+'"'+"\nsql=sql & c1\nsql = sql & "+'"'+"','"+'"'+"\nsql=sql & c2\nsql=sql & "+'"'+"')"+'"'+"\ndim conn\nSet conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nConn.Execute(SQL)\nConn.Close\nset conn=nothing\n" + str + "\n%>\n";
}
  return;
} 



function del() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<"+"%Dim rs,id,sQL,conn\nSet Conn=Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet Rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nid = request.form("+'"'+"id"+'"'+")\nSQL = "+'"'+"delete from"+'"'+"\nsql = sql & "+'"'+" table1"+'"'+"\nSQL = SQL & "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nconn.close\nset conn=nothing\n" + "\n%><center>\nLa fiche a été supprimée avec succès!\n</center>\n\n"+ str;
}
  return;
} 



function mod() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<"+"%"+"dim id,champ,SQL,conn,rs\nchamp=request.form("+'"'+"champ"+'"'+")\nchamp=replace(champ,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nchamp=replace(nom,vbcrlf,"+'"'+"<br>"+'"'+")\nid=request.form("+'"'+"id"+'"'+")\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nSQL ="+'"'+" update"+'"'+" \nsql = sql & "+'"'+" table1 "+'"'+"\nsql = sql &  set \nsql=sql & "+'"'+" champ ="+'"'+"\nsql= sql & "+'"'+"'"+'"'+" \nsql=sql & champ\nsql=sql & "+'"'+"'"+'"'+"\nSQL = SQL &  "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nConn.Close\nSet conn = Nothing" + "\n%><center>\nLa fiche a été modifiée avec succès!\n</center>\n\n"+ str;
}
  return;
} 

function efface() {
  document.formulaire.texte.value="";
} 


function cadreT() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET ROWS= "+'"'+"30%,70%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</FRAMESET>\n</html>\n"+ str;
}
  return;
} 

function cadreGD() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n"+ str;
}
  return;
} 

function cadreHB() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET rows= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"b"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n"+ str;
}
  return;
} 

function fform() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<form name="+'"'+""+'"'+" action="+'"'+""+'"'+" method="+'"'+""+'"'+">\n<input type="+'"'+"text"+'"'+" name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n<input type="+'"'+"submit"+'"'+" value="+'"'+""+'"'+">\n</form>\n"+ str;
}
  return;
} 


function fselect() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<select name="+'"'+""+'"'+">\n<option></option>\n<option></option>\n</select>\n"+ str;
}
  return;
} 

function fbouton() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<input type=button value="+'"'+""+'"'+">\n"+ str;
}
  return;
} 


function fsoumettre() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<input type=submit value="+'"'+""+'"'+">\n"+ str;
}
  return;
} 


function fcb() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<input type=checkbox name="+'"'+""+'"'+">\n"+ str;
}
  return;
} 




function fmopa() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<input type=password name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n"+ str;
}
  return;
} 

function fradio() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<input type=radio name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n"+ str;
}
  return;
} 


function ftext() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<input type=text name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n"+ str;
}
  return;
} 

function fhidden() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<input type=hidden name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n"+ str;
}
  return;
} 
function ftextarea() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<textarea name="+'"'+""+'"'+" rows=10 cols=60 ></textarea>\n"+ str;
}
  return;
} 

function ol() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var vstyle = prompt("Tipo: 1 | A | a | I | i","1");
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<ol type="+vstyle+">\n<li>\n<li>\n</ol>\n"+ str;
}
  return;
} 

function ul() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var vstyle = prompt("Tipo: square | disc | circle","circle");
  var lien = "";
  if (lien != null) {
	var sel = document.selection.createRange();
sel.text = "<ul type="+vstyle+">\n<li>\n<li>\n</ul>\n"+ str;
}
  return;
} 



// unhide -->

</script>


<% else
'Mac%>
<script language="JavaScript1.2">
<!-- hide
function efface() {
document.formulaire.texte.value="";
} 

function pmtaille() {
var vtaille = prompt("Titulo:","3");
var str=document.formulaire.texte.value
document.formulaire.texte.value = str + "\n<font size=\"" + vtaille  + "\">"  + "</font>\n";
}

function mailto() {
var cour = prompt("Email:","");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<a href=\"mailto:" + cour + "\">" + cour + "</a>\n";
} 


function fhtml() {
document.formulaire.texte.value="<html>\n<head>\n<title></title>\n</head>\n<body>\n\n\n</body>\n</html>\n"  +"\n";
}


function ol() {

var vstyle = prompt("Tipo: 1 | A | a | I | i","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<ol type=\""+ vstyle+"\">\n<li>\n<li>\n</ol>\n";
} 

function ul() {
var vstyle = prompt("Tipo: square | disc | circle","circle");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<ul type=\""+ vstyle+"\">\n<li>\n<li>\n</ul>\n";
} 

function valide() {
  document.reel.contenu.value=document.formulaire.texte.value
  document.reel.submit()
}

function format(f) {

var vtex = prompt("Texto","Votre texte");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<" + f + ">" +vtex+ "</" + f + ">\n";
}



function balisesf(f) {
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<" + f + ">"  +"\n";
}


function lien() {
var lien = prompt("URL:","http://");
var tar= prompt("Cible (target) :","");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<a href=\"" + lien  +'"'+ " target=\"" + tar + "\">"  + "</a>\n";
} 



function pmcolor() {
var colo = prompt("Cores (anglais ou código:","black");
var str=document.formulaire.texte.value
document.formulaire.texte.value = str + "\n<font color=\"" + colo  + "\">"  + "</font>\n";
}

function limage() {
var lim = prompt("URL de image:","");
var haut = prompt("Altura:","20");
var larg = prompt("Largura:","20");
var valt = prompt("Descrição:","Mon image");


var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<img src=\"" +lim  + "\" height=\""+ haut+ "\" width=\""+larg+"\" alt=\""+ valt+"\">"  + "\n";
} 

function ftable(f) {
var hor = prompt("Largura em pixel ou % ","300");
var vbgcol = prompt("Cor de fundo ","white");
var bord = prompt("Bordure, 1 à 5","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<table border=\""+ bord+ "\" bgcolor=\""+vbgcol+ "\" width=\""+hor+"\">\n<tr>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n</tr>\n</table>" +"\n";
}



function ftitre() {
var letit = prompt("Nivel de 1 à 6","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<h" + letit + ">"+  "</h" + letit + ">" + "\n";
} 


function fancre() {
var letit = prompt("Nom","");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<a name=" + letit + ">"+ "\n";
} 

function fhr() {
var hor = prompt("Largura em pixel ou % ","300");
var haut = prompt("Altura em pixel ","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<hr size=" + haut+ " width="+hor +">"+  "\n";
} 



function fform() {
var str = document.formulaire.texte.value
document.formulaire.texte.value=  str+ "\n<form name="+'"'+""+'"'+" action="+'"'+""+'"'+" method="+'"'+""+'"'+">\n<input type="+'"'+"text"+'"'+" name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n<input type="+'"'+"submit"+'"'+" value="+'"'+""+'"'+">\n</form>\n";
}



function fselect() {
var str = document.formulaire.texte.value
document.formulaire.texte.value=  str+ "\n<select name="+'"'+""+'"'+">\n<option></option>\n<option></option>\n</select>\n";
}


function fbouton() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=button value="+'"'+""+'"'+">\n";
}















function fcb() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=checkbox name="+'"'+""+'"'+">\n";
}





function fmopa() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=password name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n";
}


function fradio() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=radio name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n";
}



function ftext() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=text name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n";
}


function fhidden() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=hidden name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n";
}




function ftextarea() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<textarea name="+'"'+""+'"'+" rows=10 cols=60 ></textarea>\n";
}



function fsoumettre(){
var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=\"submit\" value=\"\">\n ";
}



function asp() {
var str=document.formulaire.texte.value
document.formulaire.texte.value =str+"\n<\"%@ Language=VBScript %>\n";
}


function asp1() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str + "\n<"+"% "+"%>\n";
} 


function asp2() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%= %>\n";
} 

function fconn() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%Dim rs,sql,conn\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\n"+"Set rs= Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\n"+"Conn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")"   +"\nsql ="+'"'+"SELECT * FROM table1"+'"\n'+ "rs.Open sql, conn , 2, 3 \n"+"conn.execute(sql)\ndo while not rs.eof\n" +"response.write rs.fields("+'"'+"field1"+'"'+").value"+"\nrs.movenext\nloop\nrs.Close\nSet rs = Nothing\nConn.Close\nSet Conn = Nothing\n" + "\n%>\n";
} 


function comm() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%'"  + "%>\n";
} 



function ajou() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"% dim c1,c2\nc1=request.form("+'"'+"c1"+'"'+")\nc1=replace(c1,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nc2=request.form("+'"'+"c2"+'"'+")\nc2=replace(c2,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\ndim sql\nSQL = "+'"'+"INSERT INTO table1(c1,c2)VALUES ('"+'"'+"\nsql=sql & c1\nsql = sql & "+'"'+"','"+'"'+"\nsql=sql & c2\nsql=sql & "+'"'+"')"+'"'+"\ndim conn\nSet conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nConn.Execute(SQL)\nConn.Close\nset conn=nothing\n" + "\n%>\n";
} 



function del() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%Dim rs,id,sQL,conn\nSet Conn=Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet Rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nid = request.form("+'"'+"id"+'"'+")\nSQL = "+'"'+"delete from"+'"'+"\nsql = sql & "+'"'+" table1"+'"'+"\nSQL = SQL & "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nconn.close\nset conn=nothing\n" + "\n%><center>\nLa fiche a été supprimée avec succès!\n</center>\n\n";
} 

function mod() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%"+"dim id,champ,SQL,conn,rs\nchamp=request.form("+'"'+"champ"+'"'+")\nchamp=replace(champ,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nchamp=replace(nom,vbcrlf,"+'"'+"<br>"+'"'+")\nid=request.form("+'"'+"id"+'"'+")\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nSQL ="+'"'+" update"+'"'+" \nsql = sql & "+'"'+" table1 "+'"'+"\nsql = sql &  set \nsql=sql & "+'"'+" champ ="+'"'+"\nsql= sql & "+'"'+"'"+'"'+" \nsql=sql & champ\nsql=sql & "+'"'+"'"+'"'+"\nSQL = SQL &  "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nConn.Close\nSet conn = Nothing" + "\n%><center>\nLa fiche a été modifiée avec succès!\n</center>\n\n";
 } 





function cadreT() {
document.formulaire.texte.value= "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET ROWS= "+'"'+"30%,70%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</FRAMESET>\n</html>\n";
}
  
function cadreGD() {
	document.formulaire.texte.value= "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n";
}


function cadreHB() {
  document.formulaire.texte.value="<html>\n<head>\n<title></title>\n</head>\n<FRAMESET rows= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"b"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n";
}

// unhide -->

</script>
<%end if %>

Compartilhar este post


Link para o post
Compartilhar em outros sites

beleza, sem problemas, como te disse , existe varios, o FCKeditor é ótimo tb, mas outros códigos , você esta mais livre para alteração a seu gosto...

surgindo duvidas, é só postar...

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.