LBF Forms and Value Size

midder wrote on Sunday, April 17, 2011:

Hello

It looks as though the ‘value’ field for the LBF forms is varchar 255? Is there a way to allow more than 255 characters? Other than changing the database field type? I have a client who wants to put much more data in that in a textarea field.

Thanks

sunsetsystems wrote on Sunday, April 17, 2011:

There is a “textarea” field type already, type 3.

Rod
www.sunsetsystems.com

midder wrote on Monday, April 18, 2011:

Apologies I guess I wasn’t clear. The field is indeed rendered as a text field. The problem is that the field in the database holding the value is varchar255, so the value gets truncated at 255 characters. Is there a way around this limitation?

midder wrote on Monday, April 18, 2011:

By “text field” I mean textarea.

yehster wrote on Monday, April 18, 2011:

Just change the field yourself using MySQL workbench or the like.

ALTER TABLE `openemr`.`lists` CHANGE COLUMN `title` `title` VARCHAR(1024) NULL DEFAULT NULL  ;

I’m not even sure which column it is as I don’t use LBF.

midder wrote on Tuesday, April 19, 2011:

Right. I had considered that, but wanted to see if there was a better way to do this. The 255 character limit was done by design, I suppose? Is there a way around it?

Thanks for your reply.

sunsetsystems wrote on Tuesday, April 19, 2011:

Yes 255 seems too small for a textarea, I agree something should be done about that.

Rod
www.sunsetsystems.com

midder wrote on Tuesday, April 19, 2011:

Do you have any suggestions Rod? Is there a better way to make custom forms? I’ve read about the XML form generator but haven’t implemented anything yet. I’ve done a little bit w some custom PHP but would like to avoid that, if possible. Is there one method of creating forms that would be better than another? Better supported? etc.

Thanks again.

sunsetsystems wrote on Tuesday, April 19, 2011:

Suggest you edit the lbf_data table definition using phpmyadmin, and change the data type of the field_value column from “varchar(255)” to “mediumtext”.  Of course be sure to make a backup first.  I expect that’s all you need to do.

Rod
www.sunsetsystems.com

penguin8r wrote on Thursday, April 21, 2011:

^ Rod’s suggestion above should work fine.  I have had to edit the data types for many forms, replacing varchar with mediumtext or text as needed to make things work.  The varchar problem comes from a change, I think between MySQL version 4 & version 5, at one point varchar could be up to 65535 characters, then it was restricted to 255.

midder wrote on Thursday, April 21, 2011:

I was actually just typing a reply when your note came through.

I did just that. I altered the column so that it is now mediumtext as opposed to varchar. My testing last night went without issue, so it appears to have worked and is what I need for this.

Thank you for your suggestion, Rod, and everyone else for taking the time to reply.