Сообщение от lexexpert
|
Подскажите, пожалуйста, как можно занести переменную "pid" в тег html?
Пример кода:
<script type="text/javascript">
var tar = 20;
var pid = $("#pid").val();
if(tar== 20) {
$("#pshow").html("<select name='pid' class='text' size='1' ><option value=''></option><? $ressw = mysql_query ('SELECT * FROM products WHERE id_user = \'"+pid+"\' ORDER BY id DESC ');$myrowss = mysql_fetch_array($ressw);do{printf('<option value=\'%s\'>%s (%s)</option><br>',$myrowss['id'],$myrowss['pname'],$myrowss['type']);}while ($myrowss = mysql_fetch_array($ressw)); ?></select>");}
</script>
|
var pid = $("#pid").val();
$("#pshow").html("<select name='"+pid+"' class='text' size='1' ><option value=''></option><? $ressw = mysql_query ('SELECT * FROM products WHERE id_user = \'"+pid+"\' ORDER BY id DESC ');$myrowss = mysql_fetch_array($ressw);do{printf('<option value=\'%s\'>%s (%s)</option><br>',$myrowss['id'],$myrowss['pname'],$myrowss['type']);}while ($myrowss = mysql_fetch_array($ressw)); ?></select>");
подставлена в атрибут name select-a