Hi, all. I'm a newbie to joomla and have run into a couple of problems with custom fields.
Using the guidelines found at http://forum.joomla.org/viewtopic.php?f=428&t=352285
(working solution is at bottom of page 2) I have successfully added several custom fields to a joomla site. They display and update fine. Now, I need to do 2 other things and can't figure them out:
1) Add data validation when a new article is added.
2) Convert 3 of the text boxes to select lists.
1) Page /libraries/joomla/database
tent.php has a function named "Check()" that appears to validate the other (standard) article fields. Example:
Article must have a title'));
However, if I edit the function by copying this code and changing the field name ("title") to one of my custom fields ("url"), I get a 500 error if "url" is left blank. This tells me the test is working but "setError" is not doing what I expected. I'd like to use the same "alert" type validation that joomla uses, but how do I add?
2) Working on /administrator/components/
.php, three of the new fields need to be changed from text boxes to select lists. The values to include in the list of options are in tables in the joomla database. When I try to make a new connection to the db to run the query, I get "Error Loading Modules" message at the top of the page and, in the "Parameters" area, the following error message:
Warning: Invalid argument supplied for foreach() in [*site root removed*]/libraries/joomla
p on line 68.
The db connect is good because I tested on a blank page, and I've not touched the page referenced by the error.
I'm assuming that joomla already has a db connection established, so I could use that if I knew the variable. In any case, what do I do to connect and run my queries for the select options?
Any help deeply appreciated! If more info needed, just ask.