超超管管
能帮下不?
因为用户模板没几套好看的,不能满足用户需求,不能个性自己的页面。所有本人在做用户首页可视编辑器。编辑页面为首页公司简介内从新调整用户模板布局。
现在我的编辑器已经嵌入进去。但是提交数据时就过滤了“< >”等符号
所有今天特来请教。
<script Language="JavaScript">
function gosure()
{
var i=confirm("你确定要删除吗?");
if(i)
{
return true;
}
else
{
return false;
}
}
function FormCheck()
{
if (trim(document.Form1.qymc.value) =="")
{
alert("请输入公司全称!");
document.Form1.qymc.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_EmployeesCount.value) =="")
{
alert("请选择公司员工人数!");
document.Form1.p_z_Z_EmployeesCount.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_LegalStatus.value) =="")
{
alert("请选择企业类型!");
document.Form1.p_z_Z_LegalStatus.focus();
return (false);
}
var check=true;
for(var i=0;i<document.Form1.qylb.length;i++){
if (document.Form1.qylb[i].checked) {
check=false;
break;
}
}
if (check){
alert("请选择企业经营模式!");
document.Form1.qylb[0].focus();
return (false);
}
if (trim(document.Form1.p_z_Z_AnnualRevenue.value) =="")
{
alert("请选择企业年营业额!");
document.Form1.p_z_Z_AnnualRevenue.focus();
return (false);
}
if(trim(document.Form1.productionService.value) == "")
{
alert("主要相关产品名/服务名最少要填一个\n\n并且按左至右的顺序填写");
document.Form1.productionService.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_FoundedPlace.value) =="")
{
alert("请填写公司注册地!");
document.Form1.p_z_Z_FoundedPlace.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_BizPlace.value) =="")
{
alert("请填写主要经营地点!");
document.Form1.p_z_Z_BizPlace.focus();
return (false);
}
if (trim(document.Form1.qyjj.value.length) <50)
{
alert("公司介绍不能少于50字");
document.Form1.qyjj.focus();
return (false);
}
if (trim(document.Form1.qyjj.value.length) >3000)
{
alert("公司介绍不能多于2000字");
document.Form1.qyjj.focus();
return (false);
}
if (trim(document.Form1.phonecountry.value) =="")
{
alert("请输入联系电话的国家区号!");
document.Form1.phonecountry.focus();
return (false);
}
var filter=/^\s*[0-9]{0,3}\s*$/;
if (!filter.test(document.Form1.phonecountry.value)) {
alert("国家区号不正确,请重新填写!不超过3个数字,注意不要使用空格。");
document.Form1.phonecountry.focus();
document.Form1.phonecountry.select();
return false;
}
if (trim(document.Form1.phonearea.value) =="")
{
alert("请输入联系电话的城市区号!");
document.Form1.phonearea.focus();
return (false);
}
var filter=/^\s*[0-9]{0,4}\s*$/;
if (!filter.test(document.Form1.phonearea.value)) {
alert("城市区号不正确,请重新填写!不超过4个数字,注意不要使用空格。");
document.Form1.phonearea.focus();
document.Form1.phonearea.select();
return false;
}
if (trim(document.Form1.phonenumber.value) =="")
{
alert("请输入您的联系电话号码!");
document.Form1.phonenumber.focus();
return (false);
}
if (trim(document.Form1.country1.value) =="中国")
{
if (trim(document.Form1.province.value) =="")
{
alert("请选择省份!");
document.Form1.province.focus();
return (false);
}
if (trim(document.Form1.city.value) =="")
{
alert("请选择地级城市!");
document.Form1.city.focus();
return (false);
}
}
if (trim(document.Form1.address.value) =="")
{
alert("请输入您的联系地址!");
document.Form1.address.focus();
return (false);
}
if (trim(document.Form1.email.value) =="")
{
alert("请输入您的电子邮件地址!");
document.Form1.email.focus();
document.Form1.email.select();
return false;
}
var str1 = document.Form1.email.value
if(str1.indexOf("@") == -1 || str1.indexOf(".") == -1){
alert("E-mail格式不正确,请重新填写!");
document.Form1.email.focus();
document.Form1.email.select();
return false;
}
var productionService = Form1.productionService.value;
for(i=0;i<productionService.length;i++){productionService=productionService.replace(',',',');}
if(Form1.productionService2.value){
for(i=0;i<Form1.productionService2.value.length;i++){Form1.productionService2.value=Form1.productionService2.value.replace(',',',');}
productionService+=','+Form1.productionService2.value;
}
if(Form1.productionService3.value){
for(i=0;i<Form1.productionService3.value.length;i++){Form1.productionService3.value=Form1.productionService3.value.replace(',',',');}
productionService+=','+Form1.productionService3.value;
}
Form1.p_z_Z_productionService.value = productionService
document.Form1.submit()
}
//-->
//-->
function trim(inputString) {
if (typeof inputString != "string") { return inputString; }
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") {
//检查字符串开始部分的空格
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") {
//检查字符串结束部分的空格
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) {
//将文字中间多个相连的空格变为一个空格
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length);
}
return retValue;
}
//-->
</script>
function gosure()
{
var i=confirm("你确定要删除吗?");
if(i)
{
return true;
}
else
{
return false;
}
}
function FormCheck()
{
if (trim(document.Form1.qymc.value) =="")
{
alert("请输入公司全称!");
document.Form1.qymc.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_EmployeesCount.value) =="")
{
alert("请选择公司员工人数!");
document.Form1.p_z_Z_EmployeesCount.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_LegalStatus.value) =="")
{
alert("请选择企业类型!");
document.Form1.p_z_Z_LegalStatus.focus();
return (false);
}
var check=true;
for(var i=0;i<document.Form1.qylb.length;i++){
if (document.Form1.qylb[i].checked) {
check=false;
break;
}
}
if (check){
alert("请选择企业经营模式!");
document.Form1.qylb[0].focus();
return (false);
}
if (trim(document.Form1.p_z_Z_AnnualRevenue.value) =="")
{
alert("请选择企业年营业额!");
document.Form1.p_z_Z_AnnualRevenue.focus();
return (false);
}
if(trim(document.Form1.productionService.value) == "")
{
alert("主要相关产品名/服务名最少要填一个\n\n并且按左至右的顺序填写");
document.Form1.productionService.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_FoundedPlace.value) =="")
{
alert("请填写公司注册地!");
document.Form1.p_z_Z_FoundedPlace.focus();
return (false);
}
if (trim(document.Form1.p_z_Z_BizPlace.value) =="")
{
alert("请填写主要经营地点!");
document.Form1.p_z_Z_BizPlace.focus();
return (false);
}
if (trim(document.Form1.qyjj.value.length) <50)
{
alert("公司介绍不能少于50字");
document.Form1.qyjj.focus();
return (false);
}
if (trim(document.Form1.qyjj.value.length) >3000)
{
alert("公司介绍不能多于2000字");
document.Form1.qyjj.focus();
return (false);
}
if (trim(document.Form1.phonecountry.value) =="")
{
alert("请输入联系电话的国家区号!");
document.Form1.phonecountry.focus();
return (false);
}
var filter=/^\s*[0-9]{0,3}\s*$/;
if (!filter.test(document.Form1.phonecountry.value)) {
alert("国家区号不正确,请重新填写!不超过3个数字,注意不要使用空格。");
document.Form1.phonecountry.focus();
document.Form1.phonecountry.select();
return false;
}
if (trim(document.Form1.phonearea.value) =="")
{
alert("请输入联系电话的城市区号!");
document.Form1.phonearea.focus();
return (false);
}
var filter=/^\s*[0-9]{0,4}\s*$/;
if (!filter.test(document.Form1.phonearea.value)) {
alert("城市区号不正确,请重新填写!不超过4个数字,注意不要使用空格。");
document.Form1.phonearea.focus();
document.Form1.phonearea.select();
return false;
}
if (trim(document.Form1.phonenumber.value) =="")
{
alert("请输入您的联系电话号码!");
document.Form1.phonenumber.focus();
return (false);
}
if (trim(document.Form1.country1.value) =="中国")
{
if (trim(document.Form1.province.value) =="")
{
alert("请选择省份!");
document.Form1.province.focus();
return (false);
}
if (trim(document.Form1.city.value) =="")
{
alert("请选择地级城市!");
document.Form1.city.focus();
return (false);
}
}
if (trim(document.Form1.address.value) =="")
{
alert("请输入您的联系地址!");
document.Form1.address.focus();
return (false);
}
if (trim(document.Form1.email.value) =="")
{
alert("请输入您的电子邮件地址!");
document.Form1.email.focus();
document.Form1.email.select();
return false;
}
var str1 = document.Form1.email.value
if(str1.indexOf("@") == -1 || str1.indexOf(".") == -1){
alert("E-mail格式不正确,请重新填写!");
document.Form1.email.focus();
document.Form1.email.select();
return false;
}
var productionService = Form1.productionService.value;
for(i=0;i<productionService.length;i++){productionService=productionService.replace(',',',');}
if(Form1.productionService2.value){
for(i=0;i<Form1.productionService2.value.length;i++){Form1.productionService2.value=Form1.productionService2.value.replace(',',',');}
productionService+=','+Form1.productionService2.value;
}
if(Form1.productionService3.value){
for(i=0;i<Form1.productionService3.value.length;i++){Form1.productionService3.value=Form1.productionService3.value.replace(',',',');}
productionService+=','+Form1.productionService3.value;
}
Form1.p_z_Z_productionService.value = productionService
document.Form1.submit()
}
//-->
//-->
function trim(inputString) {
if (typeof inputString != "string") { return inputString; }
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") {
//检查字符串开始部分的空格
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") {
//检查字符串结束部分的空格
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) {
//将文字中间多个相连的空格变为一个空格
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length);
}
return retValue;
}
//-->
所在页面
/member/corporation/company_edit.asp