Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Insert line break via PME

phpMyEdit General     Insert line break via PME
Post new topic   Reply to topic    
 
reber     Joined: 23 Jun 2003   Posts: 10  
Post Posted: 2004-08-19 21:28
Back to top  Reply with quote     

Hello all,
I'm pretty certain this is a routine topic, but I can't find any answers...

How does one go about inserting a line break when adding/changing a record using PME fields?

I'm trying to introduce '\r' to some addresses. Everything I've tried shows up as typed, not converted to line breaks.

Thanks for the assistance,
Reber

 
reber     Joined: 23 Jun 2003   Posts: 10  
Post Posted: 2004-12-02 22:40
Back to top  Reply with quote     

Apparently, this topic wasn't of interest to many other people, but I was annoyed by not being able to insert a line break from a PME edit field. I tried everything, believing that my problem was user error.

Eventually, I used a Write SQL expression [sqlw] to replace character '|' with '\n', presumably taking place after any preprocessing by PME.

This worked. Line breaks are now available by using | to signal termination when adding or editing records in this particular column (address_update).

*Note the [sql] expression preventing PME from removing the line break on a subsequent edit. It returns | to the editable record.*

example:

tedious|example
--becomes-->
tedious
example

Code:

$opts['fdd']['address_update'] = array(
  'name'     => 'Updated Address',
  'select'   => 'T',
  'maxlen'   => 60,
  'sort'     => true,
  'options'  => 'VCD'
);
$opts['fdd']['address_update']['sql'] = 'REPLACE(address_update, "\n", "|")';
$opts['fdd']['address_update']['sqlw'] = 'REPLACE($val_qas, "|", "\n")';



 
michal     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2004-12-03 13:04
Back to top  Reply with quote     

did you try 'textarea' as input field ? (you can have more rows when adding / changing)

 
ceaza     Joined: 05 Sep 2007   Posts: 3  
Post Posted: 2008-12-11 00:24
Back to top  Reply with quote     

Thanks a lot after hours of searching :)

Code:
$opts['fdd']['address_update']['sql'] = 'REPLACE(address_update, "\n", "|")';
$opts['fdd']['address_update']['sqlw'] = 'REPLACE($val_qas, "|", "\n")';


Worked like a dream

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy