JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 23rd, 2000, 01:37 PM
gjs gjs is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Posts: 10 gjs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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>";
.
.
.

Reply With Quote
  #2  
Old May 24th, 2000, 02:13 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan


<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..."

Reply With Quote
  #3  
Old May 24th, 2000, 10:26 AM
gjs gjs is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Posts: 10 gjs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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')}

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Opening new indexed window w javascript

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap