| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 776 人关注过本帖
标题:求助这段 ASP 页面中的动态表格,如何加代码才能保存到 ACCESS 数据库中?
只看楼主 加入收藏
wogo
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2014-4-13
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
求助这段 ASP 页面中的动态表格,如何加代码才能保存到 ACCESS 数据库中?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="http://ajax.
<style type="text/css">
    /*reset.css Start*/
    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
    form,fieldset,input,textarea,span,p,blockquote,th,td {
    padding: 0;
    margin: 0;
    }
    table {
    border-collapse: collapse;
    border-spacing: 0;
    }
    fieldset,img {
    border: 0;
    }
    address,caption,cite,code,dfn,em,strong,th,var {
    font-weight: normal;
    font-style: normal;
    }
    ol,ul {
    list-style: none;
    }
    caption,th {
    text-align: left;
    }
    h1,h2,h3,h4,h5,h6 {
    font-weight: normal;
    font-size: 100%;
    }
    q:before,q:after {
    content:'';
    }
    abbr,acronym { border: 0;
    }
    /*reset.css End*/
    table{margin: 10px auto 0;}
    td,th{padding: 5px 10px; text-align: center;}
    .add,.remove{color: blue; text-decoration: underline; cursor: pointer; margin: 0 5px;}
    .i_color_error,.i_model_error{display: none; color: red;}
    .pirce2,.shulian,.ku,.tiaoma{width: 70px;}
    .pic{color: #333333; width: 150px;}
    #i_model_add{background: #FF8000; color: #EEEEEE; padding: 3px 5px; box-shadow: 0px 1px 1px 1px #CCCCCC; border-radius: 3px; cursor: pointer; margin-left: 5px;}
</style>

</head>

<body>
<div style="width: 750px; margin: 50px auto 0;">
        <div>颜色分类:<input id="i_color" width="30" /><span class="i_color_error">*</span></div>
        <div>规格型号:<input id="i_model" width="40" /><span class="i_model_error">*</span><span id="i_model_add">增加</span></div>
        <table width="750" border="1" cellpadding="4" cellspacing="1"  bordercolor="#C9DBEF" id="ctr" >
          <tr>
            <td>颜色</td>
            <td>图片</td>
            <td>规格</td>
            <td>价格</td>
            <td>数量</td>
            <td>仓库</td>
            <td>条码</td>
            <td>删除</td>
          </tr>           
        </table>   
          <script type="text/javascript">
            (function($){
            var color = '';
            var model = '';
            var bool;
            var td_size = $('#ctr tr:first td').size();
            var tr;
            var index = 0;
            var boo_index;
            var rowspan;
            var click_bool;
            $('#i_model_add').click(function(){
                bool  = false;
                boo_index = true;
                model = $('#i_model').val().trim();
                color = $('#i_color').val().trim();
                if(model == ''){
                    bool = true;
                    $('.i_model_error').show();
                }
                else{
                    $('.i_model_error').hide();
                }
                if(color == ''){
                    bool = true;
                    $('.i_color_error').show();
                }
                else{
                    $('.i_color_error').hide();
                }
                if(bool){
                    return false;
                }
                $('.sekuan').each(function(){
                    if($(this).html() == color){
                        rowspan = $(this).parent().attr('rowspan');
                        if(rowspan > 0){
                            rowspan ++;
                        }
                        else{
                            rowspan = 2;
                        }
                        $(this).parent().attr('rowspan',rowspan);
                        $(this).parent().parent().find('.pic').parent().attr('rowspan',rowspan);
                        tr = '<tr><td><span class="guige">' + model + '</span></td><td><input class="pirce2" value="<%=rs_buy("price2")%>"></td><td><input class="shulian" /></td><td><select class="ku"><option value="<%=rs_ku("id")%>"><%=rs_ku("ku")%></option></select>    </td><td><input class="tiaoma" value="<%=rs_buy("tiaoma")%>"></td><td><span class="remove">删除</span></td></tr>';
                        $(this).parent().parent().after(tr);
                        boo_index = false;
                    }
                });
                if(boo_index){
                    tr = '<tr><td><span class="sekuan">' + color + '</span></td><td><input type="file" class="pic" /></td><td><span class="guige">' + model + '</span></td><td><input class="pirce2" value="rs_buy("price2")"></td><td><input class="shulian" /></td><td><select class="ku"><option value="<%=rs_ku("id")%>"><%=rs_ku("ku")%></option></select></td><td><input class="tiaoma" value="<%=rs_buy("tiaoma")%>"></td><td><span class="remove">删除</span></td></tr>';
                    $('#ctr tbody').append(tr);
                }
            });
            $('.remove').live('click',function(){
                if($(this).parent().parent().find('td').size() == td_size && (!$(this).parent().parent().find('td:first').attr('rowspan') || $(this).parent().parent().find('td:first').attr('rowspan') == 1)){
                    $(this).parent().parent().remove();
                }
                if($(this).parent().parent().find('td').size() < td_size){
                    click_bool = true;
                    $(this).parent().parent().prevAll('tr').each(function(){
                        if(click_bool && $(this).find('td:first').attr('rowspan')){
                            rowspan = $(this).find('td:first').attr('rowspan');
                            rowspan --;
                            $(this).find('td:first,td:eq(1)').attr('rowspan',rowspan);
                            click_bool = false;
                        }
                    });
                    $(this).parent().parent().remove();
                }
                if($(this).parent().parent().find('td').size() == td_size && $(this).parent().parent().find('td:first').attr('rowspan') > 1){
                    rowspan = $(this).parent().parent().find('td:first').attr('rowspan');
                    rowspan --;
                    $(this).parent().parent().next().prepend($(this).parent().parent().find('td:first,td:eq(1)').clone()).find('td:first,td:eq(1)').attr('rowspan',rowspan);
                    $(this).parent().parent().remove();
                }
            });
        })(jQuery);
        </script>
</div>
</body>
</html>
搜索更多相关主题的帖子: javascript title style 数据库 content 
2014-05-10 21:34
诸葛修勤
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:11
帖 子:549
专家分:1955
注 册:2010-10-28
收藏
得分:20 
属于数据库操作  在asp中 搜索相关的系统接口
2014-05-13 18:18
wogo
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2014-4-13
收藏
得分:0 
那请问要怎么写呢
2014-05-15 19:11
快速回复:求助这段 ASP 页面中的动态表格,如何加代码才能保存到 ACCESS 数据库 ...
数据加载中...
 
   



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

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