Okay, i got answer by lost of hours time. Here is my correct code :
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<script langauge="javascript">
function post_value(id){
opener.document.f1.p_name.value = document.forms[id].c_name.value;
self.close();
}
</script>
</head>
<body>
<?php
$host="localhost";
$username="root";
$password="";
$db_name="rawatinap";
mysql_connect("$host", "$username", "$password")or die("Gagal terkoneksi dengan database");
mysql_select_db("$db_name")or die("Tidak bisa memilih database");
$edit = mysql_query("SELECT id_obat from obat");
?>
<table >
<?php
$id=0;
while($rows=mysql_fetch_array($edit)){
echo "
<form name=$id method='post' action=''><tr>
<td><input type=\"text\" name=\"c_name\" size=\"30\" value=\"$rows[id_obat]\" /></td>
<td><input type=button value='Submit' onclick='post_value($id)'</td></tr>
</form>";
$id++;
}
?>
</table>
</body>
</html>