Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Input width size in Admin

    How do I change the input box size in admin area? Let say for Products Name.
    Using Zen Cart 1.5.1

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Input width size in Admin

    For built-in fields like Products Name, change the field length in the database, by editing the products table in phpMyAdmin.
    You will then need to go change all other tables which store a product name, else those will lose the extra characters when data is saved to them.
    Tread carefully. Make database backups before changing anything. Test in an offline copy of your site before changing things on your live store.

    WARNING: long product names will also affect layout on your storefront. Be very sure about what you're doing before taking it live.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Input width size in Admin

    Dr. Byte - I do not want to change the actual Product Name character length. I want to change the box size in admin displaying the product name.

    In fact, I have created 2 additional fields to the zen_Products table,
    Field 1: varchar(32) utf8_general_ci Yes NULL
    Field 2: varchar(96) utf8_general_ci Yes NULL

    Even thought the in SQL table sizes are 32 and 96 for field 1 and 2, when in admin viewing the product detail, the input box displays 20 characters for both fields. I need to be able to expand the actual box size to view the entire text.

    And as for the Product name field the box size shows only 45 characters, and you would not be able to see the entire 64 characters of the product name.

    What area controls the display?
    Using Zen Cart 1.5.1

  4. #4
    Join Date
    Nov 2005
    Location
    France
    Posts
    576
    Plugin Contributions
    8

    Default Re: Input width size in Admin

    Try line 138 of admin/includes/stylesheet.css
    textarea {
    width: 80%;
    }

    If you inspect the element of the products name entry box you see:
    <input type="text" name="products_name[1]" value="You've Got Mail Linked" size="51" maxlength="64">

    80% of 64(maxlength) gives you 51(size)

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Input width size in Admin

    Quote Originally Posted by Kevin205 View Post
    Even thought the in SQL table sizes are 32 and 96 for field 1 and 2, when in admin viewing the product detail, the input box displays 20 characters for both fields.
    If it is generating HTML for those input fields that forces it to 20 chars length, then that means your Zen Cart is unable to read the field sizes from MySQL, thus the field sizes are being set to default.
    This means your MySQL isn't supplying the metadata about the tables' fields correctly.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Input width size in Admin

    Quote Originally Posted by strelitzia View Post
    Try line 138 of admin/includes/stylesheet.css
    textarea {
    width: 80%;
    }

    If you inspect the element of the products name entry box you see:
    <input type="text" name="...
    Um, a selector named "textarea" doesn't refer to "INPUT" fields like: <input type="text"...>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Input width size in Admin

    Quote Originally Posted by strelitzia View Post
    Try line 138 of admin/includes/stylesheet.css
    textarea {
    width: 80%;
    }

    If you inspect the element of the products name entry box you see:
    <input type="text" name="products_name[1]" value="You've Got Mail Linked" size="51" maxlength="64">

    80% of 64(maxlength) gives you 51(size)
    As I change the value of width: 80%; to width: 100%;, I still see size="51" maxlength="64"

    Shouldn't I be looking input area also?
    Last edited by Kevin205; 22 Jun 2013 at 02:16 AM.
    Using Zen Cart 1.5.1

  8. #8
    Join Date
    Nov 2005
    Location
    France
    Posts
    576
    Plugin Contributions
    8

    Default Re: Input width size in Admin

    Quote Originally Posted by DrByte View Post
    Um, a selector named "textarea" doesn't refer to "INPUT" fields like: <input type="text"...>
    Well isn't that just a spooky coincidence that 80% of the 64 character length is the length of the input box and that it happens to be the very next line in the css after checkbox,input,radio,select,textarea,file{ font-size:11px; }

    I stand corrected :)

  9. #9
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Input width size in Admin

    Quote Originally Posted by DrByte View Post
    If it is generating HTML for those input fields that forces it to 20 chars length, then that means your Zen Cart is unable to read the field sizes from MySQL, thus the field sizes are being set to default.
    This means your MySQL isn't supplying the metadata about the tables' fields correctly.
    DrByte - How and where could this be checked?
    Using Zen Cart 1.5.1

  10. #10
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Input width size in Admin

    Quote Originally Posted by DrByte View Post
    If it is generating HTML for those input fields that forces it to 20 chars length, then that means your Zen Cart is unable to read the field sizes from MySQL, thus the field sizes are being set to default.
    This means your MySQL isn't supplying the metadata about the tables' fields correctly.
    In admin product area:
    Products Name: Displays only 45 characters
    Products Model: Displays only 30 characters
    Or, select an existing image file from server, filename: Displays only 20 characters
    Using Zen Cart 1.5.1

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v150 Change display-width of account input fields
    By mi16chap in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 8 May 2012, 12:41 PM
  2. size of input fields
    By luciano9876 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 12 Feb 2011, 07:41 PM
  3. Change width of input boxes on login page
    By jeking in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 15 Mar 2010, 05:43 PM
  4. Text Area Input Size v1.2.6
    By jacque427 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Mar 2007, 04:07 AM
  5. Increase Size of Input Boxes
    By jacque427 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 1 Mar 2007, 09:47 PM

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