RE: [PHP] Javascript Alert
| From: | Jeroen Wesbeek | Date: | Thu, 26 Oct 2000 11:43:12 +0000 |
| Subject: | RE: [PHP] Javascript Alert | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-22111@lists.php.net to get a copy of this message | ||
I think it's beacause you forgot to place a ; behind the alert function.
Also
where do you print it? In html I don't think you can use javascript:alert(),
only
in the onClick tag of an href or something. Try this:
<?php
print "<script language='JavaScript'>alert('Please fill in all the
fields');</script>\n";
?>
dowebwedo
Jeroen Wesbeek
.programming
St. Jacobsstraat 16
Postbus 448 | 3500 AK Utrecht
The Netherlands
p 030 2348110 | f 030 2348605
[roses are red, violets are blue,
I am schizophrenic and so am I ]
-----Original Message-----
From: sannec27@eng.uab.edu [mailto:sannec27@eng.uab.edu]
Sent: donderdag 26 oktober 2000 4:47
To: php-general@lists.php.net
Subject: [PHP] Javascript Alert
Hi all,
I am having a simple form which collects the age and name of the users. The
names of First Name and Age fields are fn and age respectively. i want to
pop up an alert box if somebody doesn't fill any of the two fields. I am
trying with the following code but it is somehow not working:
if (!$fn || !$age)
<?php
echo \"javascript:alert(\'Please fill in all the fields\')\";
?>
Can any one please tell me what's the error in this line is.
thanks
Chakravarthy K Sannedhi
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net