Re: php-java formatting

From: Date: Mon, 23 Dec 2002 13:18:01 +0000
Subject: Re: php-java formatting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-129177@lists.php.net to get a copy of this message
> I am using a javascript alert box in one of my php pages to tell the user > they didn't fill out all the required fields. As I check each field, if it > is blank I am adding to the alert string: > > $alertstring="Missing Mandatory Fields"; > if ($fname==''){ > $alertstring=$alertstring."First Name"; > } > > ............etc > > I am then out putting the code with prints. > > <? Print "<script> alert('$alertstring') </script>"; > > This all works fine except I want each empty field of the alert box to be on > it's own line. I try adding \n to the lines of the alert string but it > prints out the \n. How can I format this string so that it shows correctly > in the alert box? Try using <br>, maybe, or ask on a Javascript list. ---John Holmes...

« previous php.general (#129177) next »