I want to take the value that assigned to the variable 'sData' and place it in a HTML hidden input field. The javascript below resides in the header section. I'm having problems getting the value to be properly placed in a hidden input field on my HTML page to be passed to my server for querying and processing.
<script>
// Individual cell data
$(document).ready(function() {
oTable = $('#example').dataTable();
oTable.$('tr').click( function () {
var sData = oTable.fnGetData( this )[0];
// alert( 'The cell clicked on had the value of '+sData );
} );
} );
</script>
... I want the sData value to be placed in an HTML input field in the body of the page similar to this:
input type="hidden" id="lookup" name="lookup" value="sData"
How would I achieve this, and where should any code additions be placed?
Thanks for your help!
<script>
// Individual cell data
$(document).ready(function() {
oTable = $('#example').dataTable();
oTable.$('tr').click( function () {
var sData = oTable.fnGetData( this )[0];
// alert( 'The cell clicked on had the value of '+sData );
} );
} );
</script>
... I want the sData value to be placed in an HTML input field in the body of the page similar to this:
input type="hidden" id="lookup" name="lookup" value="sData"
How would I achieve this, and where should any code additions be placed?
Thanks for your help!