Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I echo results of a query in a pop up window?

Status
Not open for further replies.

skootz

Technical User
Jan 22, 2003
11
GB
Hi, I'm using the following piece of code to check if users have entered data into a form . . .

if((!$first_name) || (!$last_name) || (!$company) || (!$email_address) || (!$username)){
echo 'You did not submit the following required information! <br />';
if(!$first_name){
echo &quot;First Name is a required field.<br />&quot;;
}
if(!$last_name){
echo &quot;Last Name is a required field. <br />&quot;;
}
if(!$company){
echo &quot;Your Company Name is a required field. <br />&quot;;
}
if(!$email_address){
echo &quot;Email Address is a required field. <br />&quot;;
}
if(!$username){
echo &quot;Desired Username is a required field. <br />&quot;;
}

I was wondering how I echo the results of my query in a pop up window, rather than on a blank page - is this possible?

Thankyou in advance!
 
You can open a window from a Javascript function. Use something like this:

var doc = winMyWindow.document;
doc.open();
doc.write(str);
doc.close();
winMyWindow.focus();

...where the contents of 'str' is already set to a string containing the code for a standard page, such as '<html><title>Message</title><body>.......etc.'
 
THANKYOU!!

I didn't realise you could specify a target within a form......DOH!
As always I was looking for the complicated answer when there is a simple one just staring right at me.

Thanks again!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top