PHPMaker by default will add the comma (,) separator in combobox lookup field when you display more than one field in it. Let's say in the Customers table, I have a field named Office which setup as the Combobox, and this field will lookup to the Offices table. So, I will link this Office field (Link field) to the Office_Code field in the Offices table from PHPMaker. Afterwards, I want to display in that Office combobox lookup field: the Office_Name as the Display field #1, and Office_Code as the Display field #2 from PHPMaker. After generating the script files, then the value in that Office field will look like (for example) as JAKARTAPUSAT, 10000.
The question is, how can I remove that comma separator as I don't want to display the comma separator in it? In other words, from that example above, I just want to display the value in the Combobox as JAKARTAPUSAT 10000. Well, the answer for the question is by customizing the PHPMaker template file. Only a little modification though, this is very useful for you when you don't want to display the comma separator in all of your lookup combobox fields in your web application.
[hidepost]
-
Open your /Script/phpfn.php file, and find this code:
function ew_ValueSeparator($rowidx, $dispidx, &$fld) { return ", "; }
then replace it with the following code:
function ew_ValueSeparator($rowidx, $dispidx, &$fld) { return " "; // original: return ", "; // modified by Masino Sinaga, April 9, 2012 }
- Finally, re-generate your related script files to apply the changes.
[/hidepost]
Leave a Reply
You must be logged in to post a comment.