|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I edit a client record in a new window using javascript and PHP?
I query a client database and add links to the #'s of the records returned. I want to link on that record no (id) to open a new window so i can edit that record. How do a pass the id no to javascript so javascript opens the correct record in the new window? part of the PHP routine . . . <script language="JavaScript"> function clientwindow(idsel) { window.open('clientedit.php3?id=idsel','Client','width=400,height=450,directories=no,location=no,men ubar=no,status=no,toolbar=no,resizable=no,left=150,top=150,screenX=150,screenY=1 50') } </script> // the clientedit.php routine works . . . // this part seems to work $id=result["id"]; $id="<a href="javascript:clientwindow($id)">".$id."</a>"; . . . |
|
#2
|
||||
|
||||
|
<script language="JavaScript"> function clientwindow(idsel) { window.open('clientedit.php3?id=idsel','Client','width=400,height=450,directories=no,location=no,men ubar=no,status=no,toolbar=no,resizable=no,left=150,top=150,screenX=150,screenY=1 50') } </script> first of all you will have to concatenate "idsel" variable.other wise it wont condider this as a variable. //window.open('clientedit.php3?id='+idsel+', just print this java script in side your php script. echo "<script language="JavaScript">n"; echo "function clientwindow(idsel)n"; echo "{window.open('clientedit.php3?id='+idsel+','Client','width=400,height=450,directories=no,location=no ,menubar=no,status=no,toolbar=no,resizable=no,left=150,top=150,screenX=15 0,screenY=1 50')}n"; echo "</script>n"; see whether the above thing is working or not.. ------------------ SR - shiju.dreamcenter.net "The fear of the LORD is the beginning of knowledge..." |
|
#3
|
|||
|
|||
|
Thanks for the code. I had to make a minor change to 1 line. I moved the code back out of php and it still works. I was originally missing the + sign and had the ' in the wrong place. Thanks again. It works great.
{window.open('clientedit.php3?id='+idsel,'Client','width=400,height=450,directories=no,location=no,m enubar=no,status=no,toolbar=no,resizable=no,left=150,top=150,screenX=150,screenY =150')} |
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > Opening new indexed window w javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|