Dont really get your question? Do you mean can you print php, and javascript together? If that was the quesiton then yes you can, i prefer to brake out of php and then just place the html/javascript in.
Ohh, if you place the script inside say a php file, then you can actually print php into it, would not work if it was a external one linked tho.
yes code is function update() { frm2.unt.value=frm2.box1.options[frm2.box1.selectedIndex].text; frm1.untcd.value=frm2.box1.value; frm1.vch_cd.value=frm2.box1.options[frm2.box1.selectedIndex].text; //alert(frm2.unt.value); frm2.submit(); //alert(frm2.unt.value); rw=document.getElementById('tbls1').rows.length; var x=document.getElementById('tbls1').insertRow(rw); document.getElementById('tbls1').rules="rows"; var w=x.insertCell(0); var y=x.insertCell(1); var z=x.insertCell(2); var a=x.insertCell(3); var p=x.insertCell(4); w.width="2%"; y.width="30%"; z.width="40%"; p.width="5%"; w.align="right"; y.align="left"; z.align="left"; a.align="left"; p.align="right"; <?php $rt="select * from t_fa_voucher where vch_no='".$_POST['unt']."'"; //echo "de".$rt; $rt1=pg_query($rt); while($rt2=pg_fetch_row($rt1)) { ?> w.innerHTML="<?php echo $rt2[2];?>"; y.innerHTML="<?php echo $rt2[2];?>"; z.innerHTML="<?php echo $rt2[2];?>"; a.innerHTML="<?php echo $rt2[2];?>"; <?php } ?> } k here i needed to fetch the data from database inside js? could it be possible here? thx
Yes you can just start the php like you have and enter in your php code to get the information. Just make sure you print it out in the correct format.