This topic is locked

Drop Down Address

12/14/2007 5:59:25 AM
PHPRunner General questions
G
Greeham author

Hello,
Is it possible to have carriage return in a drop down filed list? i.e I have a drop down appear with an adress in it as a result of a dependat drop down but the address appears on one line but would like it to appear on multi lines. I have tried changing it to View as HTMl and inserting
on the database entry but it just shows a
between the address variables:-
example:- If I select a customer then the address box fills in with the address but address shows like 250 East Avenue\r\nSan Francisco\r\nUSA
How do i get it that when I select a customer the address drop down fills with:-
250 East Avenue

San Francisco

USA
Thanks,
Graham

J
Jane 12/14/2007

Graham,
unfortunately it's impossible to show address in more then one line.

As workaround use this code as Custom expression:

concat(AddressField,', ',CityField,' ',CountryField)

G
Greeham author 12/14/2007

Graham,

unfortunately it's impossible to show address in more then one line.

As workaround use this code as Custom expression:


Hi Jane,
Would that be where the look up table fields are selected or the View As tab?
Thanks,
Graham

J
Jane 12/17/2007

Graham,
you can use this code in the Display field dropdown box on the "Edit as" settings dialog.

G
Greeham author 12/17/2007

Thanks for your help Jane.
Another few questions I am having problems with, is there any way of chganging the <<Record Added>> text after Adding a record, to something of my choosing?
And lastly, i am trying to add some line breaks and boldness to my emailed Added entry and when I put any html coding in there it just shows up in the email as such rather than actual changing:-
i.e $email="email@email.com";

$subject="Request";
$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers = "From: ".$values["username"]." <".$values["date"].">\n ";
$label = "Instrument";

$message.=$label.": ".$values["instrument"]."\r\n";

$label = "Date";

$message.=$label.": ".$values["date"]."\r\n";

$label = "Engineer";

$message.=$label.": ".$values["engineer"]."\r\n";

$label = "Customer";

$message.=$label.": ".$values["customer"]."\r\n";

$label = "Project";

$message.=$label.": ".$values["project"]."\r\n";

$label = "Address 1";

$message.=$label.": ".$values["address1"]."\r\n";

$label = "Address 2";

$message.=$label.": ".$values["address2"]."\r\n";

$label = "Address 3";

$message.=$label.": ".$values["address3"]."\r\n";

$label = "State";

$message.=$label.": ".$values["state"]."\r\n";

$label = "Postcode";

$message.=$label.": ".$values["postcode"]."\r\n";

$label = "Country";

$message.=$label.": ".$values["country"]."\r\n";

$label = "Part Number";

$message.=$label.": ".$values["part_noa"]."\r\n";

$label = "Part Description";

$message.=$label.": ".$values["part_namea"]."\r\n";

$label = "Quantity";

$message.=$label.": ".$values["quantityparta"]."\r\n";
I want the Part Number returned value and the Part Description returned value to be bold but if I put my html code in there it shows as text as opposed to actually making it bold.
Thanks again,
Graham

D
drh 12/17/2007

Hi Graham,

Not sure if this will help you any, but google the php function ereg_replace. I think this may help you. Then you can use something like:
set address1 like this after you have read the values in:
$address1 = ereg_replace("\n", "12", $address1);
and then when you are appending $address1 to $message use this code:
$address1=preg_replace("/(1512)|(15)|(12)/","&nbsp;<br />", $address1);
Not sure if this helps, but it may shed some light on it. As for the bold fields, you should be able to use the above code to accomplish this also.
Dave

J
Jane 12/18/2007

Greeham,
to change <<Record Added>> message add your text to $message variable in the Before record added event.

G
Greeham author 12/18/2007

Thanks Dave and Jane,
I am a little unsure of the making a portion of the email in bold lettering. So if I have a sample:-

===============

$email="email@email.com";

$subject="Request";
$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers = "From: ".$values["username"]." <".$values["date"].">\n ";
$label = "Instrument";

$message.=$label.": ".$values["instrument"]."\r\n";

$label = "Date";

$message.=$label.": ".$values["date"]."\r\n";

$label = "Engineer";

$message.=$label.": ".$values["engineer"]."\r\n";

===============
I want the Date to be in bold lettering, I have tried all combinations I have found on the forum and all don't apply the boldness but a <b> and </b> around the Date.
Thanks again,
Graham