表单提交(插入效果)javascript_javascript技巧

function use_mine(itemid){
if(!itemid){
return;
}
var dir=Math.ceil(itemid/1000);
img_src='http://img.zol.com.cn/bbs/little/l_'+dir+'/'+itemid+'.gif';
document.getElementById('face_to_insert').innerHTML="";
document.getElementById('face_to_show').src=img_src;
}

function message(userid,messageid){
var tr;
tr = 'http://v1.bbs.zol.com.cn/user/send_msg.php?userid=' + userid+'&messageid='+messageid;
window.open(tr,'message','width=470,height=382');
}

function CopyRssUrl(url){
if(!url){
return;
}
window.clipboardData.setData('Text',url);
alert('Rss地址已复制到剪贴版');
}

function add_hexun(){
t=document.title;
u=location.href;
e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'');
void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes'));
document.getElementById('hexun_bookmark').src='http://v1.bbs.zol.com.cn/tips/hexun_bookmark.php';
}

function ckform(obj){
if(0==obj.content.value.length){
alert('内容不能空啊!');
obj.content.focus();
return false;
}
if(img_src){
ToAdd = " [IMG]"+img_src+"[/IMG]";
obj.content.value += ToAdd;
}
obj.submit_data.value='正在提交..';
obj.submit_data.disabled=true;
return true;
}

function reply_this(nickname,userid,level,headpic){
document.location = '#top_reply';
var info_str='对 ';
if(level){
info_str+='第'+level+'楼';
}else{
info_str+='楼主';
}
info_str+=' '+nickname+'  说:';
document.reply_form.reply_info.value=info_str;
document.reply_form.reply_to_userid.value=userid;
document.reply_form.content.focus();
}

//对于匿名发贴网友 回复定位到回复框
function sysauto_reply(){
document.location = '#top_reply';
document.reply_form.content.focus();
}

function ctlent(eventobject){
if(event.ctrlKey && window.event.keyCode==13){
if(img_src){
ToAdd = " [IMG]"+img_src+"[/IMG]";
document.reply_form.content.value += ToAdd;
}
if(ckform(document.reply_form)){
document.reply_form.submit();
document.reply_form.submit_data.disabled=true;
}
}
}
function setsuper(tr){
str = '['+ tr +']' + document.reply_form.content.value + '[/'+ tr +']';
document.reply_form.content.value = str;
}
function onsize(){
ToAdd = '[size='+document.reply_form.fbsize.value+']' + document.reply_form.content.value + '[/size]';
document.reply_form.content.value = ToAdd;
}
function readCookie(name){
var cookieValue = '';
var search = name + '=';
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search);
if (offset != -1)
{
offset += search.length;
end = document.cookie.indexOf(';', offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}

function writeCookie(name, value, hours){
var expire = '';
if(hours != null)
{
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = '; expires=' + expire.toGMTString();
}
document.cookie = name + '=' + escape(value) + expire;
}

function Cimage(){
var enterURL = prompt("请输入图片网址", "http://");
if (enterURL){
ToAdd = " [URL=http://v1.bbs.zol.com.cn/tips/show_linkpic.php?piclink="+enterURL+"][IMG]"+enterURL+"[/IMG][/URL]";
}
if(ToAdd){
document.reply_form.content.value += ToAdd;
}
}

function Cswf(){
var enterSIZE = prompt("输入Flash尺寸(宽,高)!", "WIDTH=300 HEIGHT=250");
var enterURL = prompt("请输入Flash网址", "http://");
if (enterURL)
{
ToAdd = "[FLASH]"+enterURL+" "+enterSIZE+"[/FLASH]";
}
if(ToAdd){
document.reply_form.content.value += ToAdd;
}else{
return;
}
}

function Curl(){
var FoundErrors = '';
var enterURL = prompt("输入链接网址!", "http://");
var enterTxT = prompt("输入链接说明!", "说明");
if (!enterURL)
{
FoundErrors += "\n" + "链接网址不能为空";
}
if (!enterTxT)
{
FoundErrors += "\n" + "链接说明不能为空";
}
if (FoundErrors)
{
alert("错误!"+FoundErrors);
return;
}
str = "[URL="+enterURL+"]"+enterTxT;
document.reply_form.content.value += str;
document.reply_form.content.value += "[/URL]";
}

操作
字体大小
1234567
内容
图片及更多功能
图片
卡通图标 
012345678901234567890123456789

 [完成后可按 Ctrl+Enter 发布]

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

时间: 2024-08-03 18:17:36

表单提交(插入效果)javascript_javascript技巧的相关文章

PHP 表单提交给自己_php技巧

在大部分情况下我们指定另外一个来处理表单内容的URL地址给Action属性,但也有部分情况是需要将表单数据提交给自己的.这时候我们应该如何指定Action属性值呢?<?php if (isset($_POST['action']) && $_POST['action'] == 'submitted') {     print '<pre>';     print_r($_POST);     print '<a href="'. $_SERVER['PHP

php表单提交实例讲解_php技巧

本文为大家分享了一个特别简单的php表单提交实例,具体的实现步骤如下: 实例代码如下: <form action="someform.php" method="post"> <table width="541" border="0"> <tr> <td width="26%">姓名:</td> <td width="74%"

html+ashx 表单提交示例_实用技巧

1,sumbit表单提交 WebForm1.aspx源码: 复制代码 代码如下: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="NETFormDemo.ashx.WebForm1" %> <!DOCTYPE html> <html xmlns="http://ww

js 判断文件类型并控制表单提交示例代码_javascript技巧

下面的代码 实现的控制表单提交 复制代码 代码如下: function shangchuan(){ var filepath = document.getElementById("file").value; alert(filepath); if(filepath==""){ alert("请选择上传的文件!"); document.getElementById("file").disabled=true; } var ext

JS控制表单提交的方法_javascript技巧

本文实例讲述了JS控制表单提交的方法.分享给大家供大家参考.具体如下: <Script Language="JavaScript"> function autoSubmit(){ var form = document.forms[0]; var actionPath = "?mo=phone"; form.action = actionPath; form.submit(); return true; } </Script> 如果需要两个提

JS两种类型的表单提交方法实例分析_javascript技巧

本文实例分析了JS两种类型的表单提交方法.分享给大家供大家参考,具体如下: 1.原始的 <form method="post" action="/student/stureg/add" id="form1" onsubmit="return subForm();"> <button type="submit" class="button red" style="

javaScript技巧(2):表单提交验证类

javascript|表单提交|技巧 1 表单项不能为空 <script language="javascript"> <!-- function CheckForm() { if (document.form.name.value.length == 0) { alert("请输入您姓名!"); document.form.name.focus(); return false; } return true; } --> </scrip

Asp.Net模拟表单提交数据和上传文件的实现代码_实用技巧

如果你需要跨域上传内容到另外一个域名并且需要获取返回值,使用Asp.Net的作为代理是最好的办法,要是客户端直接提交到iframe中,由于跨域是无法用javascript获取到iframe中返回的内容的.此时需要在自己的网站做一个动态页作为代理,将表单提交到动态页,动态页负责将表单的内容使用WebClient或HttpWebRequest将表单数据再上传到远程服务器,由于在服务器端进行操作,就不存在跨域问题了. WebClient上传只包含键值对的文本信息示例代码: 复制代码 代码如下: str

php表单提交与$_POST实例分析_php技巧

本文实例分析了php的表单提交与$_POST.分享给大家供大家参考.具体如下: 这里要注意:表单 checkbox 的 name 需要以数组形式来命名. 表单文件:index.php 复制代码 代码如下: <form action="b.php" method="post"> 用户名:<input type="text" name="username"><br /> 密码:<input