ubb<script>
/*
* 功能:UBB编辑控制函数
* 参数: tag 为标签名称 val 为标签参数
* 返回:[标签名称=参数]修饰文字[/标签名称]
* [标签名称]修饰文字[/标签名称]
* [标签名称=参数][/标签名称]
*/
function ubbaction(tag, val){
var tag = tag.toUpperCase();
if(typeof(val) == "undefined"){
val = "";
}
if(val){
val = "=" + val;
}
var r = document.selection.createRange().text;
if(tag == "URL"){
val = prompt("请输入连接地址:(留空为选定地址)", "http://");
if(val != "http://" && val != ""){
val = "=" + val;
}else{
val = "";
}
}
if(tag == "MAIL"){
val = prompt("请输入邮箱地址:(留空为选定地址)", "");
if(val != ""){
val = "=" + val;
}
}
rr = "[" + tag + val + "]" + r + "[/" + tag +"]";
if(r){
document.selection.createRange().text = rr;
}else{
document.all.content.value += rr;
}
}
</script>
<form name="form1" method="post" action="">
<input type="button" name="Submit" value="B" >
<input type="button" name="Submit" value="I" >
<input type="button" name="Submit" value="U" >
<select name='ffont' >
<option value='0'>FONT</option>
<option value='Arial' <option value='Times' <option value='Courier' <option value='Impact' <option value='Geneva' <option value='Optima' </select>
<select name='fsize' >
<option value='0'>SIZE</option>
<option value='1'>Small</option>
<option value='7'>Large</option>
<option value='14'>Largest</option>
</select>
<select name='fcolor' >
<option value='0'>COLOR</option>
<option value=black <option value=red <option value=yellow <option value=pink <option value=green <option value=orange <option value=purple <option value=blue <option value=beige <option value=brown <option value=teal <option value=navy <option value=maroon <option value=limegreen </select>
<input type="button" name="Submit" value="URL" >
<input type="button" name="Submit" value="IMG" >
<input type="button" name="Submit" value="CODE" >
<input type="button" name="Submit" value="MAIL" >
<input type="button" name="Submit" value="QUOTE" >
<input type="button" name="Submit" value="LIST" >
<textarea name="content" cols="50" rows="8" id="content"></textarea>
<input type="submit" name="Submit" value="提交">
</form>
UBB编辑器原来就这么简单
80酷酷网 80kuku.com