RE: [PHP] Javascript Alert

From: Date: Thu, 26 Oct 2000 04:50:48 +0000
Subject: RE: [PHP] Javascript Alert
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22047@lists.php.net to get a copy of this message
Try this instead: <?php if (!$fn || !$age) { echo "<script language=\"javascript\">"; echo "alert(\"Please fill in all the fields\");"; echo "</script>"; exit; } ?> > -----Original Message----- > From: sannec27@eng.uab.edu [mailto:sannec27@eng.uab.edu] > Sent: Thursday, October 26, 2000 12:47 PM > 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 > >

« previous php.general (#22047) next »