Can I check the value of custom field using Return?

Hello there,

I wanted to check if a certain field value as the name "brenda" and if it does it will then show a response. Is it possible to do this using the return ( $ .... format?

Thank you in advance,

Regards

Comments

  • Hi,

    The values of custom fields are available in the same form as you entered them, so it's not possible to automatically add any suffix, prefix or apply any other form of processing. Not without making changes in component's layout files.
  • olo said:

    Hi,

    The values of custom fields are available in the same form as you entered them, so it's not possible to automatically add any suffix, prefix or apply any other form of processing. Not without making changes in component's layout files.

    Ok thanks - so how would I write a code to check if a certain custom field is valid or not? Thanks in advance.
  • Do you mean validating values before saving a product? That's not possible - the component doesn't allow validate extra fields data against any additional rules. Custom field can either be optional (empty or not) or required (anything different than ""), but unfortunately it's not possible to easily introduce any additional validation mechanism. Not without changing core code of the component.

    But if you would like to implement such mechanism, the files which you would surely have to modify are:

    /administrator/components/com_djcatalog2/models/item.php
    /components/com_djcatalog2/models/itemform.php

    in both files look for validateAttributes() method.
Sign In or Register to comment.