|
|
#1 |
|
Junior Member
Join Date: Mar 2009
Posts: 10
Rep Power: 1 ![]() |
4.1.1 Developer.
I have created two packages - one for cars and one for parts and literature. I use the package ID to make the extra fields visible to a user placing an ad only for the car listings but I hide those for the parts and literature listing. When I use "required" validation on the extra fields, the user who has chosen parts and literature can't go past the step requiring input of the extra fields - but - I don't want the user for parts and literature to have to fill those out. I just want the users who are listing a car to fill those extra fields out (and have them required). Car listing: extra fields show, user fills them out, now I can't make those required because the Parts & Literature listing (I think it's step 3) won't allow them go to forward if I make the extra fields required. Parts & Literature: extra fields are hidden - if required is False, all is good. If required is True, then the user can't complete a listing. I thought of using a hidden field to fill in something for the three extra fields that I'd like to make required. Is this the best way to do that? If so, what would those hidden fields be to correspond to the extra fields. I have modified the template to have the logic to hide the extra fields if the package is parts and literature. Any ideas from the experts? Thank you. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Mar 2006
Posts: 4,108
Rep Power: 100 ![]() ![]() |
Extra fields are assigned to categories. What I would do is simply have a top category for cars, another for parts and another for liturature. Assign extra fields specific to cars to just that category and extra fields specific to just lit to lit and parts to parts and let 68C handle the rest.
__________________
Larry. (Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free) Set your site apart from the competition with one of my modules...... Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2009
Posts: 10
Rep Power: 1 ![]() |
Yes, the issue with doing it with categories is that the categories are the same for each - cars, parts and literature and so it seemed to be a lot more complexity to have all of those children under the three parents when all of the children are the same.
If I were to test a hidden field, what would the field name be so that the system would think that it was a valid entry? For example: Code:
<input type="hidden" name="{WHAT IS THIS in smarty}" value=" ">
Thanks |
|
|
|
|
|
#4 | |
|
Moderator
Join Date: Mar 2006
Posts: 4,108
Rep Power: 100 ![]() ![]() |
Quote:
The extra fields are collected from the database via PHP. The HTML to represent the fields is then all pushed into a PHP variable which is in turn assigned to smarty as a smarty variable and then that variable is in the template and its contents are displayed. What I do when I want to selectively hide/display extra fields based on a package chosen, I modify the php function that collects the extra field data from the database and loads it into the variable. If its a field I want hidden the html to display it is never loaded into the variable and in turn its never displayed in the template and in turn there is no validation done on it.
__________________
Larry. (Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free) Set your site apart from the competition with one of my modules...... Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
|
|
|
|
|
#5 | |
|
Moderator
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,328
Rep Power: 39 ![]() ![]() |
Quote:
Unless I'm misunderstanding your set up (which I could be), you have the following: Categories: � Cars � Parts & Literature Listing Packages: � Cars � Parts & Literature The issue is that you don't want to have extra fields in the Parts & Literature that don't make sense so you are hiding those extra fields based on the package ID? What I believe the most straight forward solution is, is to simply edit your extra fields. Just remove the "Parts & Literature" extra fields assigned to the category. Voila, issue resolved. Example: Extra field called "transmission" assign to category "Car" only.
__________________
Mike-N-Tosh v3.1.10 Developer IndianaPC.org - A community website Sandbox v4.0.9, 4.1 Templates, Mods & Docs for sale | My blog with much content for 68 Classifieds. Web Hosting | Web Design & Development | 68 Classifieds Customizations I am not a 68C employee, just a user and try to help out |
|
|
|
|
| Bookmarks |
| Tags |
| extra field, package, required |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extra fields | seymourjames | v4 Questions & Support | 10 | 04-11-2008 02:39 PM |
| Extra Fields | Paul | v3.1 Questions & Support | 4 | 02-01-2007 07:35 PM |
| Extra Fields | 2MuchStuff | v3.1 Questions & Support | 1 | 05-03-2006 08:52 PM |
| Extra Options in Featured Ad Package | SkGold | v3.0 Questions & Support | 7 | 04-09-2006 05:56 PM |