| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 679 人关注过本帖
标题:脚本突然就不能用了,菜鸟找不出原因所在,请指教!
只看楼主 加入收藏
lgm97
Rank: 2
等 级:论坛游民
帖 子:9
专家分:14
注 册:2009-10-30
结帖率:75%
收藏
已结贴  问题点数:20 回复次数:3 
脚本突然就不能用了,菜鸟找不出原因所在,请指教!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
img {border:none;}
#sjcz_mail_box {width:976px; height:auto; margin:5px auto 5px auto; background: url(images/sjcz_main_bg.jpg) repeat-y top left;}
#sjcz_foot { height:12px; }
#zjcz_tip { height:43px; width:926px;  border: solid 1px #85dbc8; margin:15px auto; background: url(images/sjcz_tip_bg.jpg) repeat-x left;}
#zjcz_tip h1{ font-size:14px; margin:15px auto 0 15px; padding:0;}
#sjcz_form{ padding-left:75px;}
#sjcz_form .sjcz_form_intro { font-size:14px; float:left; padding-right:15px; width:111px; text-align:right;}
label{ font-size:14px}
#sjcz_epl { width:911px; height:120px; border:dashed 1px #d7d7d7; background-color:#fbfbfb; margin:15px auto; padding-left:15px;}
#sjcz_epl h2{ font-size:14px; margin:10px auto 10px 10px; padding:0;}
#sjcz_epl_text{font-size:12px; line-height:18px;}
-->
</style>

<script language="javascript" type="text/javascript">

function ipt_focus(th)
{
    th.select();
}
   
 /*****号码验证*****/
   
function sjNumCheck()
{
    var frm = document.forms["sjcz_form"];
    if(frm['sjcz_num'].value != frm['sjcz_conferm'].value)
    {
        document.getElementById('sjcz_form_conf').style.color = "red";
        document.getElementById('sjcz_form_conf').innerHTML = "*你输入的电话不一致,请核对后再次输入!";
    }
    else
    {
        document.getElementById('sjcz_form_conf').style.color = "green";
        document.getElementById('sjcz_form_conf').innerHTML = "电话号码一致";

    }
}
    /*****按键验证,仅限输入数字和减号键*****/
   
function key_check(evnt)
{
    var key_num;
    if(evnt.keyCode)
    {
        key_num = evnt.keyCode;
    }
    if(evnt.which)
    {
        key_num = evnt.which;
    }
        
    if(key_num == 45 || key_num <= 57 && key_num >= 48)
    return key_num;
    else
    return false;
}
   
    /*****表单验证*****/
   
function form_check()
{
    var frm = document.forms["sjcz_form"];
    var fnl_rt;
    /****提交前判断是否号码一致***/
    if(frm['sjcz_num'].value != frm['sjcz_conferm'].value)
    {
        alert("您输入的电话号码不一致,请检查后输入!")
        frm['sjcz_num'].select();
        fnl_rt = false;
    }

    else
        {
            /****验证输入的号码是否为正常位数****/
            if(frm['sjcz_num'].value.length > 13 || frm['sjcz_num'].value.length < 11)
            {
                alert("您输入的号码位数不正确,请检查后再次输入!");
                frm['sjcz_num'].select();
                fnl_rt = false;
            }
            
            else
            {
                var sj_num = frm['sjcz_num'].value;
                var sj_yy = getRdVln("yunYing");
                var sj_xm = getRdVln("xiangmu");
                var sj_je = getRdVln("jin_e");
                var fnl_rt = confirm("你要充值的是  " + sj_yy + "    " + sj_xm + "\n\n" +
                                     "你要充值的" + sj_xm + "号码为:  " + sj_num + "\n\n" +
                                     "你要充值金额为:  " + sj_je + "元\n\n" +
                                     "请确认以上信息正确,点击确定继续,点击取消返回修改信息!"
                                    );
            }
        }
    return fnl_rt;
}

/* dfdfd*/

function getRdVln(title)
{
    var frm = document.forms["sjcz_form"];
    var temValue;
    for(var i = 0; i<frm.length; i++)
    {   
        if(frm[i].name != title || frm[i].checked != true)
        {
            continue;
        }
        else
        {
            temValue = frm[i].value;
        }

    }
    return temValue;
}
</script>
</head>

<body>
<div id="sjcz_mail_box">
    <div id="sjcz_head"><img src="images/sjcz_main_head.jpg" alt="点点网手机充值频道;充值有优惠;到账速度快" /></div>
    <div id="zjcz_tip"><h1>手机充值优惠:在点点网充值话费一率9.9折!</h1></div>
    <div id="sjcz_form">
   
        <form id="sjcz_form" name="sjcz_form" >
        <span class="sjcz_form_intro">电话号码:</span>
        <input type="text" name="sj_num1" id="sjcz_num" value="请输入电话号码"  onkeypress = "return key_check(event)"  onfocus="ipt_focus(this)"/>
        <p />
        
        
        <span class="sjcz_form_intro">再次输入号码:</span>
        <input type="text" name="sj_num2" id="sjcz_conferm" onblur="sjNumCheck()" onkeypress = "return key_check(event)"   onfocus="ipt_focus(this)"/>
        <span id="sjcz_form_conf" style="font-size:12px; padding-left:40px;"></span>
        <p />
        
        
        <span class="sjcz_form_intro">请选择运营商:</span>
        <label  for="yidong">移动</label><input type="radio" name="yunYing" value="移动"  checked="checked"  class="sj_yy" id="yidong" />
        <label for="liantong">联通</label><input type="radio" name="yunYing" value="联通"  class="sj_yy" id="liantong" />
        <label for="dianxin">电信</label><input type="radio" name="yunYing" value="电信"  class="sj_yy" id="dianxin" />
        <p />
        
        
        <span class="sjcz_form_intro">充值项目:</span>
        <label  for="shouji">手机</label><input type="radio" name="xiangmu" id="shouji" value="手机"  checked="checked" class="sj_xm" />
        <label for="guhua">固话</label><input type="radio" name="xiangmu" id="guhua" value="固话"  class="sj_xm"  />
        <label for="xiaolingtong">小灵通</label><input type="radio" name="xiangmu" id="xiaolingtong" value="小灵通"   class="sj_xm" />
        <p />
        
        <span class="sjcz_form_intro">充值金额:</span>
        <label  for="jin_e1">30</label><input type="radio" name="jin_e" value="30" id="jin_e1" checked="checked" />
        <label for="jin_e2">50</label><input type="radio" name="jin_e" value="50" id="jin_e2" />
        <label for="jin_e3">100</label><input type="radio" name="jin_e" value="100" id="jin_e3" />
        <label for="jin_e4">200</label><input type="radio" name="jin_e" value="200" id="jin_e4" />
        <p />
        
        <span class="sjcz_form_intro">附加码:</span>
        <input type="text" name="fujiama" />
        <p />
        <div id="sjcz_fjm" style="position:relative; left:130px; background-color:#CCCCCC; width:80px;">附加码区</div>
        <br />
        <a href="#"  style="font-size:12px; color:red; position:relative; left:130px;">看不清,换一张</a>
        <p />
        <input type="submit" value=""  style="background:url(images/sjcz_submit.gif) no-repeat left; width:147px; height:32px; border:none; position:relative; left:120px;" onclick="return form_check()"/>
        </form>
    </div>
   
    <div id="sjcz_epl">
        <h2>请您留意:</h2>
        <div id="sjcz_epl_text">
        移动、联通、电信手机充值:支持全国地区(移动手机除河北、港澳台地区)<br />
        此为快速充值,30分钟内快速到账; 充值超30分钟未完成时,将会进行退款!<br />
        30元移动手机充值支持地区为上海、浙江、江苏、广东、河南、云南、北京、山东、辽宁、吉林<br />
        本充值不参加当地运营商活动!充值金额可能分多次到帐!<br />
        </div>
    </div>
    <div id="sjcz_foot"><img src = "images/sjcz_main_foot.jpg" alt="点点网手机充值频道;充值有优惠;到账速度快" /></div>
</div>
</body>
</html>
搜索更多相关主题的帖子: 指教 脚本 
2009-11-25 17:59
lgm97
Rank: 2
等 级:论坛游民
帖 子:9
专家分:14
注 册:2009-10-30
收藏
得分:0 
忙了一下午,边写边测,一直都好好的,不知道怎么回事就突然不行了……汗,我菜鸟,好心人帮帮我

2009-11-25 18:00
foktime
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:奥斯维辛
等 级:贵宾
威 望:35
帖 子:795
专家分:2742
注 册:2009-9-4
收藏
得分:20 
第95行  var sj_je = getRdVln("jin_e"); 分号应该是英文输入;
2009-11-30 08:52
aspic
Rank: 17Rank: 17Rank: 17Rank: 17Rank: 17
等 级:贵宾
威 望:51
帖 子:2258
专家分:8050
注 册:2008-2-18
收藏
得分:0 
其实浏览器会有错误提示的~
2009-11-30 09:24
快速回复:脚本突然就不能用了,菜鸟找不出原因所在,请指教!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027171 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved