Luze123654 2017-09-05 14:10 采纳率: 42.9%
浏览 1431
已采纳

这个申请表怎么提交到数据库?怎么传值?怎么在后台得到input里的值,.CS文件那怎么写?

其中“可提供服务”那里在数据库是一个字段

 ![

<div><form method="post" action="SocialWorkerApply.aspx">
    <div class="applyarea" style="float:left;width:66%;">
        <img src="../../Content/images/SocialWorkers/workersapply.png" style="float:left;width:100%;" />
        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <div style="width: 50%; float: left">
                <p style="width: 100%;">姓名</p>
                <input type="text" style="width: 50%;border-color:#3A61AF " id="name"/>
            </div>
            <div style="width: 50%; float: left;">
                <p style="width: 100%;">性别要求</p>
                <input type="radio" name="gender" style="float:left;"/>男
            <input type="radio" name="gender" style="margin-left:25%" />女
            </div>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <div style="width: 50%; float: left">
                <p style="width: 100%;">出生年月</p>
                <input type="text" style="width: 50%;" id="birth"/>
            </div>
            <div style="width: 50%; float: left">
                <p style="width: 100%;">身份证号</p>
                <input type="text" style="width: 50%;" id="IDcard"/>
            </div>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <p style="width: 100%;">住址/邮编</p>
            <input type="text" style="width: 100%;" id="address"/>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <div style="width: 50%; float: left">
                <p style="width: 100%;">手机</p>
                <input type="text" style="width: 50%;" id="phone"/>
            </div>
            <div style="width: 50%; float: left">
                <p style="width: 100%;">固话</p>
                <input type="text" style="width: 50%;" id="Tel"/>
            </div>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <div style="width: 50%; float: left">
                <p style="width: 100%;">QQ/微信</p>
                <input type="text" style="width: 50%;" id="qq"/>
            </div>
            <div style="width: 50%; float: left">
                <p style="width: 100%;">邮箱</p>
                <input type="text" style="width: 50%;" id="email"/>
            </div>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <p style="width: 100%;">紧急联系人姓名/手机</p>
            <input type="text" style="width: 100%;" id="Pname"/>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <div style="width: 50%; float: left">
                <p style="width: 100%;">职业</p>
                <input type="text" style="width: 50%;" id="work"/>
            </div>
            <div style="width: 50%; float: left">
                <p style="width: 100%;">工作(学习)单位</p>
                <input type="text" style="width: 50%;" id="gongzuodanwei"/>
            </div>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <div style="width: 50%; float: left">
                <p style="width: 100%;">学历/专业(年级)</p>
                <input type="text" style="width: 50%;" id="grade"/>
            </div>
            <div style="width: 50%; float: left">
                <p style="width: 100%;">特长</p>
                <input type="text" style="width: 50%;" id="talent"/>
            </div>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <p style="width: 100%;">志愿服务经历</p>
            <textarea style="width: 100%" rows="4" id="experience"></textarea>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <p style="width: 100%;">可提供服务时间</p>
            <%--<textarea style="width: 100%" rows="4"></textarea>--%>
            <table  style="width: 100%;border-color:blue" border="1" cellspacing="0">
                <tr>
                    <th>时间</th>
                    <th>周一</th>
                    <th>周二</th>
                    <th>周三</th>
                    <th>周四</th>
                    <th>周五</th>
                    <th>周六</th>
                    <th>周日</th>
                </tr>
                <tr>
                    <td style="text-align:center">上午</td>
                    <td><input type="checkbox" name="" value="1" id="mon1"/></td>
                    <td><input type="checkbox" name="" value="1" id="tue1"/></td>
                    <td><input type="checkbox" name="" value="1" id="wen1"/></td>
                    <td><input type="checkbox" name="" value="1" id="thu1"/></td>
                    <td><input type="checkbox" name="" value="1" id="fri1"/></td>
                    <td><input type="checkbox" name="" value="1" id="sat1"/></td>
                    <td><input type="checkbox" name="" value="1" id="sun1"/></td>
                </tr>
                 <tr>
                    <td style="text-align:center">下午</td>
                    <td><input type="checkbox" name="" value="1" id="mon2"/></td>
                    <td><input type="checkbox" name="" value="1" id="tue2"/></td>
                    <td><input type="checkbox" name="" value="1" id="wen2"/></td>
                    <td><input type="checkbox" name="" value="1" id="thu2"/></td>
                    <td><input type="checkbox" name="" value="1" id="fri2"/></td>
                    <td><input type="checkbox" name="" value="1" id="sat2"/></td>
                    <td><input type="checkbox" name="" value="1" id="sun2"/></td>
                </tr>
                 <tr>
                    <td style="text-align:center">晚上</td>
                    <td><input type="checkbox" name="" value="1" id="mon3"/></td>
                    <td><input type="checkbox" name="" value="1" id="tue3"/></td>
                    <td><input type="checkbox" name="" value="1" id="wen3"/></td>
                    <td><input type="checkbox" name="" value="1" id="thu3"/></td>
                    <td><input type="checkbox" name="" value="1" id="fri3"/></td>
                    <td><input type="checkbox" name="" value="1" id="sat3"/></td>
                    <td><input type="checkbox" name="" value="1" id="sun3"/></td>
                </tr>
            </table>
        </div>

        <div style="width: 95%; float: left; margin-left: 2.5%;">
            <p style="width: 100%;">可提供服务内容</p>
            <div style="float:left;width:100%;border:1px solid #3A61AF;text-align:center;padding-top:1%;padding-bottom:1%;">
                <div style="float: left; width: 25%;">
                    A 自闭儿童:<input type="checkbox" id="a" value="1"/>
                </div>
                <div style="float: left; width: 25%;">
                    B 助老服务:<input type="checkbox" id="b" value="1"/>
                </div>
                <div style="float: left; width: 25%;">
                    C 关怀服务:<input type="checkbox" id="c" value="1"/>
                </div>
                <div style="float: left; width: 25%;">
                    D 活动赞助:<input type="checkbox" id="d" value="1"/>
                </div>

                <div style="float: left; width: 25%;">
                    E  慈善捐款:<input type="checkbox" id="e" value="1"/>
                </div>
                <div style="float: left; width: 25%;">
                    F  活动策划:<input type="checkbox" id="f" value="1"/>
                </div>
                <div style="float: left; width: 25%;">
                    G  摄影写稿:<input type="checkbox" id="g" value="1"/>
                </div>
                <div style="float: left; width: 25%;">
                    H  其&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;他:<input type="checkbox" id="h" value="1"/>
                </div>
            </div>
        </div>
        <div style="float:left;width:95%;margin-left:2.5%;">
            可提供服务地点:<input type="text" style="border:none;border-bottom:1px solid #3A61AF;" id="fuwudidian"/>区
        </div>
       <div style="float:right;margin-right:5%">
        <input id="Apply_sub" type="button" runat="server" value="提交"/>
       </div>
    </div></form>


![图片说明](https://img-ask.csdn.net/upload/201709/05/1504620377_554119.png)图片说明

  • 写回答

2条回答 默认 最新

  • Go 旅城通票 2017-09-06 02:05
    关注

    可提供服务时间起相同的name,然后值弄不同来就行了,如周一上午的checkbox值为1-1,中午1-2,晚上1-3,周二上午2-1这样一次类推值
    服务器端直接Request.Form获取

    要么放一个hidden控件,用js遍历表格中勾选的checnbox的td所在行列下标组合成字符串赋值给hidden控件

    修改时要勾选自己拆分下进行双遍历(保存的值和dom对象)对比设置checked属性

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集