Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2011
    Posts
    168
    Plugin Contributions
    0

    Default How to define the input field as a textarea in backend

    In backend, some input fields are <input ...>, like this
    Click image for larger version. 

Name:	Capture.PNG 
Views:	43 
Size:	2.5 KB 
ID:	16672
    some input fields are <textaera...>, like this
    Click image for larger version. 

Name:	Capture.PNG 
Views:	41 
Size:	3.5 KB 
ID:	16673
    How to define the format in the sql sentence?

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: How to define the input field as a textarea in backend

    it looks like fields that have a type of mediumtext in an sql table would need the textarea input tag; fields that have a type of varchar would get get the text input tag.

    although i hardly think this is a hard fast rule.... i could be wrong.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: How to define the input field as a textarea in backend

    Not sure the exact question, but if you are looking for how to cause say a configuration field to have a text area instead of an input box, then this is/can be controlled through the assignment of the set_function field of the configuration table.

    To convert a specific entry to use a textarea (which really doesn't matter about the data type, though a short datatype which is perhaps best represented by a single text box will get truncated upon saving if a lot of information is stored in it as compared to a mediumtext or largetext and if a data field is set to say mediumtext, well if it has a lot of information then it won't look good in a single text box).

    So for example could put the following into the Tools->Insert SQL Patches area:

    Code:
    UPDATE configuration SET set_function = 'zen_cfg_textarea(' WHERE configuration_key = 'INSERT_KEY_TO_MODIFY_HERE';
    and it would update the configuration_key of INSERT_KEY_TO_MODIFY_HERE to use a textarea type field instead of whatever it currently is using. Yes, you may need to also modify the datatype of the field to obtain "better" results/performance; however, it seems that this at least in (another?) part addresses your question.

    Where as if you want a standard text field, then set the set_function = NULL and it will become a single "one-line" text field...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Oct 2011
    Posts
    168
    Plugin Contributions
    0

    Default Re: How to define the input field as a textarea in backend

    Thanks, guys. Following mc12345678's instruction, the problem was solved.

 

 

Similar Threads

  1. v152 Adding images to the 'attributes_image' field from admin backend
    By eComEvo in forum General Questions
    Replies: 2
    Last Post: 1 May 2015, 10:47 PM
  2. Make input field on collectinfo also display the field text as hyperlink
    By jpietrowiak in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 15 Dec 2012, 05:06 AM
  3. postcode input field appears way of to the right
    By icecold in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 2 Dec 2010, 11:51 AM
  4. Implementing (Limit Textarea) code into input field of "Gift Certificate" page?
    By SandraSD in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 22 Sep 2009, 12:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR