Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Default value from SQL


TaFfin

Recommended Posts

Posted

Can't figure it out....

 

How do I let the admincategories.php page show the default value of a database field?

 

In MySQL (phpMyAdmin) you can give a default value to a database field, but when inserting a new product, the default is not shown.

 

Does anybody know how to do this?

 

 

Thanx,

 

TaFfin

SIGnificant.....right?

Posted

I'd just like to show a standard value.

 

Let's say a productnumber always starts with '1234', and only the last three digits need to be filled in. It's handy when those '1234' are already present.

It works as a reminder and helps speeding up the proces of adding of new products.

 

Once again, MySQL has the ability to show default values, I just don't know how to show them in osCommerce fields.

 

Thanx,

 

TaFfin

SIGnificant.....right?

Posted

You need to change the code for that. You have a couple of options for that:

 

-Use JavaScript to enter the value and JavaScript to jump to the end of the inserted text on focus (IIRC, this is possible. But not 100% sure. Didn't check).

 

-Define the default value as a PHP variable and insert it into the form. Use JavaScript to jump to the end of the form.

 

If you need some help with the code, let us know where you want what and somebody should be able to help you.

 

HTH

 

Gunter

Archived

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

×
×
  • Create New...