I just want to ask. How can I pass a textfield values in a PHP variable within the same page? What I want is to get the variable and I will query this number to get the product's information.
Here's my code:
This is the link that
<td style='text-align: left'>
<a href="javascript:void(0)" onclick="$('#w').window('open')" data-value="<?php echo $itid ?>" class="id_prod"><?php echo $itemname; ?></a>
</td>
Below is my modal dialog:
<div id="w" class="easyui-window" title="Price History" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:500px;height:200px;padding:10px;">
<input type="text" value="" name="prod_id" value=""/> <!-- this will get the values -->
And below again is my jquery:
<script>
$(".id_prod").click(function(){
var id = $(this).attr('data-value');
$('input[name="prod_id"]').val(id) //this will pass the value to my textbox
});
</script>