久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='hcHJ7'><style id='hcHJ7'><dir id='hcHJ7'><q id='hcHJ7'></q></dir></style></legend>
      • <bdo id='hcHJ7'></bdo><ul id='hcHJ7'></ul>

      <small id='hcHJ7'></small><noframes id='hcHJ7'>

      <i id='hcHJ7'><tr id='hcHJ7'><dt id='hcHJ7'><q id='hcHJ7'><span id='hcHJ7'><b id='hcHJ7'><form id='hcHJ7'><ins id='hcHJ7'></ins><ul id='hcHJ7'></ul><sub id='hcHJ7'></sub></form><legend id='hcHJ7'></legend><bdo id='hcHJ7'><pre id='hcHJ7'><center id='hcHJ7'></center></pre></bdo></b><th id='hcHJ7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hcHJ7'><tfoot id='hcHJ7'></tfoot><dl id='hcHJ7'><fieldset id='hcHJ7'></fieldset></dl></div>
    1. <tfoot id='hcHJ7'></tfoot>

        無法使用 jQuery 獲取文本字段值

        Unable to get textfield value using jQuery(無法使用 jQuery 獲取文本字段值)
          <bdo id='iQlil'></bdo><ul id='iQlil'></ul>

            <legend id='iQlil'><style id='iQlil'><dir id='iQlil'><q id='iQlil'></q></dir></style></legend>

            <small id='iQlil'></small><noframes id='iQlil'>

                  <tbody id='iQlil'></tbody>
                <i id='iQlil'><tr id='iQlil'><dt id='iQlil'><q id='iQlil'><span id='iQlil'><b id='iQlil'><form id='iQlil'><ins id='iQlil'></ins><ul id='iQlil'></ul><sub id='iQlil'></sub></form><legend id='iQlil'></legend><bdo id='iQlil'><pre id='iQlil'><center id='iQlil'></center></pre></bdo></b><th id='iQlil'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iQlil'><tfoot id='iQlil'></tfoot><dl id='iQlil'><fieldset id='iQlil'></fieldset></dl></div>
                • <tfoot id='iQlil'></tfoot>
                • 本文介紹了無法使用 jQuery 獲取文本字段值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個 invoice.jsp 頁面,我必須使用 jQuery 在文本框中計算一些值.

                  I have an invoice.jsp page where I have to calculate some value in the textbox using jQuery.

                  在我的發票中有一個數量文本框.如果用戶輸入數量,則計算出的價格應動態計算,即 (total_subPrice= unit_price * quantity) 并顯示在另一個名為price"的文本框中.

                  In my invoice there is a quantity textbox. If the user enters the quantity then the calculated price should be calculated dynamically i.e (total_subPrice= unit_price * quantity) and shown in another textbox called "price".

                  現在我當前的輸出是這樣的:

                  Now my current output is like this:

                  我嘗試了下面的代碼來解決這個問題,但我的 jQuery 代碼無法獲取 unitprice 文本字段數據.我不知道為什么.請檢查我下面的代碼并為我提供解決方案.

                  I tried the code below to solve this issue, but my jQuery code is unable to get the unitprice textfield data. I don't know why. Please check my code below and suggest me a solution for it.

                  invoice.jsp

                  invoice.jsp

                  --------------------
                  --------------------
                  <script type="text/javascript">
                    $(document).ready(function(){
                      $(function() {
                        $('input[name^="quantity"]').change(function() {
                          var unitprice = $(this).siblings('input[name^="unitprice"]').val();
                          alert("Unit price check="+unitprice);
                          //problem in this line. Unable to get the unit price
                          $(this).siblings('input[name^="price"]').val($(this).val() * unitprice);
                        });
                      });
                    });
                  </script>
                  ..............................
                  ..............................
                  <!--
                    Here I am iterating through a list from my dabase using strus2 framework tags.
                    And defined my  input field values in struts2 tag eg. `<s:textfield.../>`
                    is the same as `<input type="text".../>
                  -->
                  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                    <s:iterator  value="#session.BOK" status="userStatus">
                      <tr style="height: 10px;">
                        <td width="65%" align="left"><s:property value="bookTitile"/></td>
                        <td width="10%" align="left">
                          <s:textfield name="unitprice" value="%{price}" size="4"/>
                        </td>
                        <td width="10%" align="center">
                          <s:textfield name="quantity" value="%{quantity}" size="2" />
                        </td>
                        <td width="15%" align="center">
                          <s:textfield value="%{price}" name="" size="6"></s:textfield>
                        </td>
                      </tr>
                    </s:iterator>
                  </table>
                  ................................
                  ................................
                  

                  當我更改數量文本框中的任何值時,我的警報框會顯示單價檢查=未定義".請檢查我的代碼并提出任何解決方案.

                  When I change any value in my quantity textbox, my alert box is showing "Unit price check=undefined". Please check my code and suggest any solution.

                  更新:生成的 html

                   inside loop {
                    <tr style="height: 10px;">
                      <td width="65%" align="left">book title display</td>
                      <td width="10%" align="left">
                        <input type="text" name="unitprice" value="%{price}" size="4"/>
                      </td>
                      <td width="10%" align="center">
                        <input type="text" name="quantity" value="%{quantity}" size="2" />
                      </td>
                      <td width="15%" align="center">
                        <input type="text" value="%{price}" name="" size="6"></s:textfield>
                      </td>
                    </tr>
                  

                  推薦答案

                  我搞定了:http:///jsbin.com/efinak/2/edit

                  $(function() {
                    $('input[name="quantity"]').change(function() {
                        var unitprice = $(this).parents('tr').find('input[name="unitprice"]').val();
                        $(this).parents('tr').find(' input[name="price"]').val($(this).val() * unitprice);
                  
                      });
                  });
                  

                  這篇關于無法使用 jQuery 獲取文本字段值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)

                    <small id='6h1jB'></small><noframes id='6h1jB'>

                    <i id='6h1jB'><tr id='6h1jB'><dt id='6h1jB'><q id='6h1jB'><span id='6h1jB'><b id='6h1jB'><form id='6h1jB'><ins id='6h1jB'></ins><ul id='6h1jB'></ul><sub id='6h1jB'></sub></form><legend id='6h1jB'></legend><bdo id='6h1jB'><pre id='6h1jB'><center id='6h1jB'></center></pre></bdo></b><th id='6h1jB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6h1jB'><tfoot id='6h1jB'></tfoot><dl id='6h1jB'><fieldset id='6h1jB'></fieldset></dl></div>

                  • <tfoot id='6h1jB'></tfoot>

                        • <bdo id='6h1jB'></bdo><ul id='6h1jB'></ul>
                          1. <legend id='6h1jB'><style id='6h1jB'><dir id='6h1jB'><q id='6h1jB'></q></dir></style></legend>

                              <tbody id='6h1jB'></tbody>
                          2. 主站蜘蛛池模板: 久久久久亚洲精品 | 东方伊人免费在线观看 | 久久亚洲国产精品 | 福利视频一区二区三区 | 亚洲福利网 | 伊人久久免费视频 | 欧美日韩成人 | 精品国产一区二区三区性色av | 99re在线视频 | 91免费版在线 | 亚洲福利精品 | 国产精品久久久久久久久图文区 | 国产日韩亚洲欧美 | 国产小视频在线观看 | 国产伦精品一区二区三区精品视频 | 视频一区二区在线观看 | 国产精品成人国产乱 | 欲色av| 久久精品一区二区三区四区 | 在线观看视频福利 | 一区二区在线不卡 | 亚洲图片视频一区 | 成人在线亚洲 | 青青久久 | av超碰 | 久久久久久久国产 | 草久久免费视频 | 日韩精品 | 欧美精品乱码久久久久久按摩 | 免费成人高清在线视频 | 九一在线 | h视频在线免费 | 免费看黄色视屏 | 玩丰满女领导对白露脸hd | 国产情品 | 中文字幕亚洲区 | 国产二区三区 | 中文字幕欧美日韩 | 日本三级网 | av男人的天堂av | 国产日韩精品视频 |