<form method=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifposthttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif id=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifdformhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif action=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif?http://www.qiyeyunshang.com/skin/gw/image/nopic.gif target=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifsendhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gifhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gifreturn check();http://www.qiyeyunshang.com/skin/gw/image/nopic.gif>
<tr>
<td class=http://www.qiyeyunshang.com/skin/gw/image/nopic.giftlhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif><span class=http://www.qiyeyunshang.com/skin/gw/image/nopic.giff_redhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif>*</span> 行业分类</td>
<td class=http://www.qiyeyunshang.com/skin/gw/image/nopic.giftrhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif><div id=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifcateschhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif></div>
{ajax_category_select('post[catid]', '选择分类', $catid, $moduleid, $DT_TOUCH ? '' : 'size=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif2http://www.qiyeyunshang.com/skin/gw/image/nopic.gif style=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifheight:120px;width:180px;http://www.qiyeyunshang.com/skin/gw/image/nopic.gif')}{if !$DT_TOUCH}<br/>
{/if}{if $DT[schcate_limit]}{/if}<span id=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifdcatidhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif class=http://www.qiyeyunshang.com/skin/gw/image/nopic.giff_redhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif></span></td>
</tr>
表单验证函数 check()
{if $action == 'add' || $action == 'edit'}
<script type=http://www.qiyeyunshang.com/skin/gw/image/nopic.giftext/javascripthttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif>
function _p() {
if(Dd('tag').value) {
Ds('reccate');
}
}
function check() {
var l;
var f;
f = 'catid_1'; //存储分类id的隐藏表单
if(Dd(f).value == 0) {
Dmsg('请选择所属分类', 'catid', 1); //Dmsg 函数在/file/script/common.js 函数详细介绍传送门
return false;
}
f = 'title';
l = Dd(f).value.length;
if(l < 2 || l > 30) {
Dmsg('信息标题应为2-30字,当前已输入'+l+'字', f); //在dtitle标签显示提示 并且不滚动到dtitle标签,
//如果想要滚动到 用Dmsg('信息标题应为2-30字,当前已输入'+l+'字', f,1);
return false;
}
{if $MOD[upload_thumb] && $MG[upload]}
f = 'thumb';
l = Dd(f).value.length;
if(l < 5) {
Dmsg('请上传第一张产品图片', f);
return false;
}
{/if}
{if !$_userid}
f = 'company';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写公司名称', f);
return false;
}
if(Dd('areaid_1').value == 0) {
Dmsg('请选择所在地区', 'areaid');
return false;
}
f = 'truename';
l = Dd(f).value.length;
if(l < 2) {
Dmsg('请填写联系人', f);
return false;
}
f = 'mobile';
l = Dd(f).value.length;
if(l < 7) {
Dmsg('请填写手机', f);
return false;
}
{/if}
{if $FD}{fields_js()}{/if}
{if $CP}{property_js()}{/if}
{if $need_password}
f = 'password';
l = Dd(f).value.length;
if(l < 6) {
Dmsg('请填写支付密码', f);
return false;
}
{/if}
{if $need_question}
f = 'answer';
l = Dd(f).value.length;
if(l < 1) {
Dmsg('请填写验证问题', f);
return false;
}
if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
Dd(f).focus();
return false;
}
{/if}
{if $need_captcha}
f = 'captcha';
l = Dd(f).value;
if(!is_captcha(l)) {
Dmsg('请填写正确的验证码', f);
return false;
}
if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
Dd(f).focus();
return false;
}
{/if}
return true;
}
var destoon_oauth = '{$EXT[oauth]}';
</script>
{/if}
Dmsg 函数详情
//Dmsg 函数在/file/script/common.js
//str-提示信息
//i-需要验证表单id ,例如 catid,title
//s-滚动到提示表单位置的开关 1-滚动,0-不滚动,提示信息是显示到id名为“d”+i的标签里的,所以页面上必须有个 dcatid 和 dtitle才行
//t-显示提示信息的时间,显示一会后会自动隐藏
function Dmsg(str, i, s, t) {
var t = t ? t : 5000; //t的默认值是5000,如果没有传t参数则默认5000毫秒。
var s = s ? 1 : 0; //s的默认值是0
var h = i == 'content' ? 450 : 50; //表单高度
try{
if(typeof Dbrowser != 'undefined') {alert(str);return;}
if(s || i == 'content'){$(http://www.qiyeyunshang.com/skin/gw/image/nopic.gifhtml, bodyhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif).animate({scrollTop:$('#d'+i).offset().top-h}, 100);}
Dd('d'+i).innerHTML = '<img src=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif'+SKPath+'image/check_error.gifhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif width=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif12http://www.qiyeyunshang.com/skin/gw/image/nopic.gif height=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif12http://www.qiyeyunshang.com/skin/gw/image/nopic.gif align=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifabsmiddlehttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif/> '+str+sound('tip');
Dd(i).focus();
}catch(e){}
window.setTimeout(function(){Dd('d'+i).innerHTML = '';}, t);
}
destoon 升级了 dmsg函数 但是这个函数也不好用
function Dmsg(str, i, s, t) {
var t = t ? t : 5000; var s = s ? true : false;
try{if(s){window.scrollTo(0,0);}Dd('d'+i).innerHTML = '<img src=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif'+SKPath+'image/check_error.gifhttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif width=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif12http://www.qiyeyunshang.com/skin/gw/image/nopic.gif height=http://www.qiyeyunshang.com/skin/gw/image/nopic.gif12http://www.qiyeyunshang.com/skin/gw/image/nopic.gif align=http://www.qiyeyunshang.com/skin/gw/image/nopic.gifabsmiddlehttp://www.qiyeyunshang.com/skin/gw/image/nopic.gif/> '+str+sound('tip');Dd(i).focus();}catch(e){}
window.setTimeout(function(){Dd('d'+i).innerHTML = '';}, t);
}