zoukankan      html  css  js  c++  java
  • 针对jquery获取表单数据并且迭代方式

    function add(){
    $("select option:selected").each(function(index){
    var name = $(this).text();
    console.log(name);
    })
    $("select").each(function(index){
    var namekey = $(this).val();
    console.log(namekey);
    })
    $("input[name='nodeForm.name']").each(function(index){
    var name = $(this).val();
    console.log(name);
    })
    $("textarea[name='nodeForm.nodeDes']").each(function(index){
    var nodeDesc = $(this).val();
    console.log(nodeDesc);
    })
    $("textarea[name='nodeForm.scanField']").each(function(index){
    var scanField = $(this).val();
    console.log(scanField);
    })



    }

    <div class="global_module news">
    <h3><s:property value="%{#node.ipStr}" /></h3>
    <div class="scrollNews">
    <div style="height:40px;">
    <div style="float:left">
    <label for="name" class="spanFont">*节点名称:</label>
    <s:textfield name="nodeForm.name" class="name" id="name" value="%{#node.name}" cssStyle="200px;"/>
    </div>
    <div style="float:right">
    <label for="nodType" class="spanFont">*节点类型:</label>
    <vwfextra:select name="nodeForm.nodType" id="nodType" codeType="nodType" disabled="true" value="%{#node.nodType}" cssStyle="200px;margin-right:8px;"/>
    </div>
    </div>
    <div style="height:60px;">
    <div style="float:left">
    <lablel class="spanFont" for="nodeDes">&nbsp;节点描述:</label>
    <s:textarea name="nodeForm.nodeDes" id="nodeDes" value="%{#node.nodeDes}" cssStyle="200px;height:50px;overflow:auto;" maxlength="256"></s:textarea>
    </div>
    <div style="float:right">
    <lablel class="spanFont" for="scanField">*安全域:</label>
    <s:textarea name="nodeForm.scanField" id="scanField" value="%{#node.scanField}" cssStyle="200px;height:50px;overflow:auto;margin-right:8px;" maxlength="256"></s:textarea>
    </div>
    </div>
    </div >
    <p class="module_up_down"><img src="<%=rootPath %>/images/nodeManage/down.gif" alt="" /></p>
    <p class="module_del"><img src="<%=rootPath %>/images/nodeManage/down.gif" alt="" /></p>
    </div>

  • 相关阅读:
    如何在tomcat安装部署php项目
    十大建站开源程序
    虚拟主机、VPS、云主机以及独立服务器的关系
    heritrix启动问题修正
    网页布局:float与position的区别
    C#中利用委托实现多线程跨线程操作
    Java Service Wrapper配置详解
    Windows7部署WordPress傻瓜式教程(IIS7.5+MySQL+PHP+WordPress)
    关于favicon.ico的使用
    使用JAVA对字符串进行DES加密解密(修正问题)
  • 原文地址:https://www.cnblogs.com/sj521/p/5428188.html
Copyright © 2011-2022 走看看