Jamie Allen Jamie Allen - 1 year ago 58
Javascript Question

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). My SVCDESC from the drop down IS getting the selected value thankfully. Any ideas? Thanks in advance guys!


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]");

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


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

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


<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>

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

Answer Source

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" />