Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staycreativedesign/f8edf94c91b64c0a489b04558beda72d to your computer and use it in GitHub Desktop.
Save staycreativedesign/f8edf94c91b64c0a489b04558beda72d to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org" />
<title></title>
</head>
<body>
<table class="mt-10">
<tbody>
<tr>
<th>Product Description</th>
<th>Qty</th>
<th>Action</th>
</tr>
<tr data-uid="1">
<td><input type="text" name="product_option_title-REQ" id="product_option_title"
value="this is the description" maxlength="200" class="short" /></td>
<td><input type="text" name="option_qty-REQ" id="option_qty" value="10"
maxlength="200" class="short" /></td>
<td><span class="update_product">Update</span></td>
</tr>
<tr data-uid="4">
<td><input type="text" name="product_option_title-REQ" id="product_option_title"
value="hey james" maxlength="200" class="short" /></td>
<td><input type="text" name="option_qty-REQ" id="option_qty" value="1" maxlength=
"200" class="short" /></td>
<td><span class="update_product">Update</span></td>
</tr>
<tr data-uid="5">
<td><input type="text" name="product_option_title-REQ" id="product_option_title"
value="dasdasaas" maxlength="200" class="short" /></td>
<td><input type="text" name="option_qty-REQ" id="option_qty" value="43223"
maxlength="200" class="short" /></td>
<td><span class="update_product">Update</span></td>
</tr>
</tbody>
</table>
</body>
</html>
$(document).ready(function() {
$('.update_product').live('click', function() {
console.log($(this).parent('td').parent('tr').data('uid'))
});
});
$(document).ready(function() {
$('.update_product').live('click', function() {
console.log($(this).parent('td').parent('tr').data('uid'))
console.log($(this).parent('td').prev('').html())
// trying to to get #option_qty.val()
});
});
trying to get the input value of
@nilbus
Copy link

nilbus commented Apr 23, 2020

console.log($(this).closest('tr').find('#option_qty').val())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment