473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

pop-up window

Hi,

Im just starting to learn PHP nor Java and I dont have any basic idea how to do this. But im asking of basic knowledge or script on how to do a pop-up window inside PHP and select the name inside the pop-up window to transfer on my main page. All I know is I have to use Java to make things work. To clarify, here the steps user will do.

1. open main page
2. cick the button contact name
3. a pop up window will appear with list box of contacts.
4. after selecting the contact people it will display the name back to main page.

I hope i made it clear. let me know if you need more information.

thanks!
Apr 6 '09 #1
23 1880
Markus
6,050 Expert 4TB
PHP is server-side; it does not interact directly with the browser.

Ask in the javascript forum.

- mark.
Apr 6 '09 #2
thanks Mark for the input
Apr 6 '09 #3
Dormilich
8,658 Expert Mod 8TB
a popup in Javascript is basicly like
Expand|Select|Wrap|Line Numbers
  1. window.open(file, name, settings);
Apr 6 '09 #4
Looks like after putting this thread on Java forum their kicking me out :) to PHP.

but anyways I was able to do the pop-up window the next problem Im having is how to copy the value selected from window 2 to window 1 back?

Expand|Select|Wrap|Line Numbers
  1. echo ' 
  2.     <h2>' . ( $id ? translate ( 'Edit Entry' ) : translate ( 'Add Entry' ) ) 
  3.  . $eType_label . '&nbsp;<img src="images/help.gif" alt="' . translate ( 'Help' ) 
  4.  . '" class="help" onclick="window.open( \'search_contact.php' 
  5.  . ( empty ( $id ) ? '?add=1' : '' ) 
  6.  . '\', \'cal_help\', \'dependent,menubar,scrollbars,height=400,width=800,' 
  7.  . 'innerHeight=420,outerWidth=420\' );" /></h2>' 
  8.  
  9.  
  10.  
Apr 6 '09 #5
Markus
6,050 Expert 4TB
Javascript, not Java. Two completely different things.

- mark.
Apr 6 '09 #6
vrsoft
9
@mychikka
Thanks that works for me.
Apr 7 '09 #7
vrsoft
9
hi i want to know more and more regarding this.
Apr 7 '09 #8
Dormilich
8,658 Expert Mod 8TB
@vrsoft
about this (the topic) or this (the JavaScript keyword)?
Apr 7 '09 #9
vrsoft
9
i want to learn php sample projects
Apr 7 '09 #10
Dormilich
8,658 Expert Mod 8TB
if you have something specific in mind open a new thread and ask it. if it's some general, you may find some articles in the insights section useful or (even more general) look for a tutorial.

the PHP Manual Pages also offer lots of useful information.
Apr 7 '09 #11
vrsoft
9
Thank you.
Thanks.actually i am new to this forums.so i don't know how to use it.
if u don't mind will u give details about this?
how to lock my thread not to be replied by others.
how will i be informed if i've got a reply 4 my post.
i wonder how u monitor our posts and replies,kindly tell me.
Apr 7 '09 #12
waqasahmed996
160 100+
you can do this in javascript just like this in popup window

Expand|Select|Wrap|Line Numbers
  1. window.opener.document.getElementById( 'xyz' ).value = value_from_contactbox 
  2. window.close();
  3.  
Apr 7 '09 #13
Dormilich
8,658 Expert Mod 8TB
@vrsoft
general advice you can find in the help section and the posting guidelines

@vrsoft
this can be done by moderators, although it's not practiced.
@vrsoft
you can change these notification settings in the user control panel. make sure to regularly check your PMs

kind regards and welcome at Bytes
Apr 7 '09 #14
vrsoft
9
may i know how you moderators monitor our posts and replies,kindly tell me.
are u having mail alert or database checking or are u having any technical user interface tool?
bcaz as soon as i posted here u would reply.so how?
Apr 7 '09 #15
Here's what I got after encorporating waqasahmed996 code but it doesn't do anything. By the way I put this script on the pop-up window or second window. Please let me know what im missing.

thanks!

Expand|Select|Wrap|Line Numbers
  1. echo "<input type='button' value='Select' onclick=window.opener.document.getElementById( 'ContactID' ).value = value_from_contactbox  window.close()'>"; 
  2.  
Apr 8 '09 #16
waqasahmed996
160 100+
you will write this code in new window. and you can write this code in java script tag. You just have to call that function according to your requirement.
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. function fname(value_of_listbox)
  3. {
  4. window.opener.document.getElementById( 'medicinename' ).value = value_of_listbox
  5. window.close();
  6. }
  7. </script>
  8.  
Apr 9 '09 #17
vrsoft
9
Why am i alone not given any answer?
Apr 9 '09 #18
Dormilich
8,658 Expert Mod 8TB
check out this post.
Apr 9 '09 #19
Thanks waqasahmed996 this what I did on my pop-up window and still does'nt work I hope Im almost there :) smile.

Java Script on top of body tag
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript"> 
  2. function contactID(ContactID) 
  3. window.opener.document.getElementById( 'ContactID' ).value = ContactID 
  4. window.close(); 
  5. </script> 

inside PHP
Expand|Select|Wrap|Line Numbers
  1. echo "<input type='button' value='". $row['contactid']. "' 
  2. onclick='ContactID(ContactID)'>";  

result:
Page Error
Apr 9 '09 #20
waqasahmed996
160 100+
error may be due to this reason that you are using Capital letter 'C' in php and small in java script 'c' while calling function ContactID

try like this

Expand|Select|Wrap|Line Numbers
  1. echo "<input type='button' value='$abc' 
  2.  onclick='contactID($abc)'>"; 
  3.  
Apr 10 '09 #21
@waqasahmed996
How can I set a value for a parameter to pass if its a result of a query.
eg. ". $row['contactid']. "
Apr 10 '09 #22
waqasahmed996
160 100+
you can write like this

Expand|Select|Wrap|Line Numbers
  1. echo "<input type='button' value='".$row['contactid']."' onclick='contactID($row[contactid])'>"; 
Apr 13 '09 #23
Dormilich
8,658 Expert Mod 8TB
some minor optimization (PHP)
Expand|Select|Wrap|Line Numbers
  1. echo "<input type='button' value='", $row['contactid'], "' onclick='contactID($row[contactid])'>"; 
Apr 13 '09 #24

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Roy Smith | last post by:
In the recent "transforming a list into a string" thread, we've been discussing the fact that list.pop() is O(1), but list.pop(0) is O(n). I decided to do a little timing experiment. To be sure,...
4
by: Andre | last post by:
Hi guys, newbie question. I am having trouble with a script that is supposed to login me to my account on yahoo pop server. When i do this: import getpass, poplib, re POPHOST =...
1
by: spencer | last post by:
Hi, The code. def buildStackMajor(): for node in dirStackMinor: #print 's is the node...', node dirStackMajor.append(node) dirStackMinor.pop() print 'POP the stack...', len(dirStackMinor)...
6
by: Will | last post by:
Hi, Sorry to be a pest... But I can figure this out. I'm pushing to a stack. then I need to check to see if the word is a palindrome. Is the code below correct? if so, how can I check the...
2
by: John Hoge | last post by:
I would like to open an exit pop when a user leaves my site, but I don't want to the back button to trigger the pop if the user remains in my site. I'm using the onUnload attribute of the Body...
15
by: Stig Brautaset | last post by:
Hi group, I'm playing with a little generic linked list/stack library, and have a little problem with the interface of the pop() function. If I used a struct like this it would be simple: ...
25
by: Nicholas Parsons | last post by:
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a...
7
by: Scott | last post by:
As said before I'm new to programming, and I need in depth explaination to understand everything the way I want to know it, call it a personality quirk ;p. With pop() you remove the last element...
4
by: j_depp_99 | last post by:
The program below fails on execution and I think the error is in my pop function but it all looks correct.Also could someone check my code as to why my print function is not working? I havent...
20
by: merrittr | last post by:
I need some C advice I want to read in string commands from a user when the user enters a \n I want to push it on the stac. Then at some point , if the user enters the word print pop off and print...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.