The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> JavaScript Development
|
Opening new indexed window w javascript
Discuss Opening new indexed window w javascript in the JavaScript Development forum on Dev Shed. Opening new indexed window w javascript JavaScript Development forum discussing JavaScript and DHTML, AJAX, and issues such as coding cross-browser JavaScript.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 23rd, 2000, 01:37 PM
|
|
Junior Member
|
|
Join Date: Feb 2000
Posts: 10
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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>";
.
.
.
|

May 24th, 2000, 02:13 AM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
<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..."
|

May 24th, 2000, 10:26 AM
|
|
Junior Member
|
|
Join Date: Feb 2000
Posts: 10
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
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')}
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|