简体   繁体   English

无法使用下拉菜单检索表行中的输入值-但能够检索下拉菜单值

[英]Unable to retrieve input values in table row using a dropdown - but able to retrieve dropdown value

I think I am close, but my (little) knowledge has come to an end... 我想我很亲近,但是我的(一点)知识已经结束了...

When executing this function, my LLORDa and LLINEa are not retrieving the values from the table row (thus not inserting all values into my table). 执行此功能时,我的LLORDa和LLINEa不会从表行中检索值(因此不会将所有值插入表中)。 My SVCDESC from the drop down IS getting the selected value thankfully. 值得庆幸的是,我从下拉菜单中获得的SVCDESC获得了所选值。 Any ideas? 有任何想法吗? Thanks in advance guys! 在此先感谢大家!

    <script>

        jQuery(function() {
            jQuery("input:submit, input[type=button], input[type=submit], button, .button").button();
        });

function saveSMR()
        {
            var SVCDescDropDown = $(this); 
            var row = SVCDescDropDown.closest("tr.row"); 

            var LORDaInput = row.find("input[name=LORDa]");
            var LLINEaInput = row.find("input[name=LLINEa]");  

            jQuery.ajax(
            {
                url: 'B2BORD493.PGM', 
                type: 'POST',
                data: {task: 'savServMiss', LORDa: LORDaInput.val(), LLINEa: LLINEaInput.val(), SVCDESC: SVCDescDropDown.val()},                
            }).done(function(message)
            {

                alert(row.length);
                jQuery('#dialog').dialog('close');      
            }); 

            console.log(LORDaInput.val() + LLINEaInput.val());      
        }

        $(document).ready(function() {
            $(function() {
                $("select[name=SVCDESC]").on("change", saveSMR);
                $("#dialog").dialog({
                    autoOpen: false
});
$("#pbutton").on("click", function() {
$("#dialog").dialog("open");

});
});
 });
    </script>



<tr class="row"> 
<td class="text num">1043121</td>
 <td class="text num">22</td>
  <select name="SVCDESC">
 <option value=""></option>
 <option value='STK'>No Stock</option>
    <option value='TES'Test Desc</option>
    </select>

  </td>
  <input type="hidden" name="LLINEa" />
  <input type="hidden" name="LORDa" />
</tr>

EDITED: Sorry I misread your question. 编辑:对不起,我看不懂你的问题。 There are no values assigned to the hidden field that you are calling. 没有任何值分配给您正在调用的隐藏字段。 Maybe that is why there are no values? 也许那就是为什么没有价值的原因?

<input type="hidden" name="LLINEa" />
<input type="hidden" name="LORDa" />

Perhaps something like these will return some values? 也许像这样的东西会返回一些值?

<input type="hidden" name="LLINEa" value="123" />
<input type="hidden" name="LORDa" value="abc" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM