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>

  • 相关阅读:
    AOP动态代理两种方式
    Spring AOP的两种代理方式
    面试中关于Redis的问题看这篇就够了
    关于redis,学会这8点就够了
    什么是MVCC
    JAVA 中BIO,NIO,AIO的理解
    JAVA异常体系结构详解
    Java多线程:由浅入深看synchronized的底层实现原理
    为什么wait,notify和notifyAll要与synchronized一起使用?
    Java并发之AQS详解
  • 原文地址:https://www.cnblogs.com/sj521/p/5428188.html
Copyright © 2011-2022 走看看