Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I change the input field length


zdavatz

Recommended Posts

Posted

Hi

 

I have one question:

 

How do I change the input field length in the Admin-Area. The input field for "Products Name:" in the Admin-Area is to short for a lot of products of mine. I always have to scroll horizontally. I would like to double the size of that filed.

 

How do I change the length of that field.

 

Any hints are very welcome.

 

Thank you.

 

Best

Zeno

Posted

Open up catalog/admin/categories.php

 

You can edit line 507 (of a standard install)

 

			<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>

 

to

 

			<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id'])), 'width="64"'); ?></td>

 

The database limit for product name is 64 characters, so the width of 64 should be fine :D

 

Of course back up first.. blah blah blah...

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

Posted

a simple way is to use inline css to define the width as the parameter for that tep function.

 

Ken

 

ps: size of number of character allowed and the PHYSICAL SIZE of the field (the input box) is two different things.

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Posted
ps: size of number of character allowed and the PHYSICAL SIZE of the field (the input box) is two different things.

 

Yes good point, my brain is too tired down here in Aus...

 

change SIZE to WIDTH and it will work - or a CSS rule as GemRock said.

Although a CSS rule won't be as accurate as a simple HTML WIDTH attribute i don't think (as far as getting all chars to display).

 

Original post edited.

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

Posted
Yes good point, my brain is too tired down here in Aus...

 

change SIZE to WIDTH and it will work - or a CSS rule as GemRock said.

Although a CSS rule won't be as accurate as a simple HTML WIDTH attribute i don't think (as far as getting all chars to display).

 

Original post edited.

 

Rob

Thank you for this reply Rob but this did not work. The size of my input field still has not changed. The length is still to short (same as before). I added the code from line 507 as you advised. The input field for "Products Name" is still only about 22 chars long.

 

I do understand the difference between the length of the field and the actual amount of chars you are allwoed to place into the field. I want to make the field longer so I do not have to scroll for long products names.

Posted
change SIZE to WIDTH and it will work - or a CSS rule as GemRock said.

 

Rob! You where right! It is "Size" _not_ "Width"! That works just great!

 

Use "SIZE"!

 

Thanks again.

 

Best

Zeno

Posted

LOL - oh well, got there in the end.

 

Yeah - size does work now that i think about it - why wouldn't it! :D

People can get me confused easily when it's late enough :D

 

You can also put maxlength="64" too to limit it to the database max (since anything longer will get cut off too).

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

  • 1 year later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...