聞きたいだけです。同じページ内のPHP変数にテキストフィールド値を渡すにはどうすればよいですか? 私が望むのは、変数を取得することです。この番号をクエリして、製品の情報を取得します。
これが私のコードです:
これはそのリンクです
<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>
以下は私のモーダルダイアログです:
<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 -->
以下は私の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>