Hello,
Is there any way for me to display only part of the custom fields?
For example:
I have custom fields:
A, B, C, D
Right now as I see it no matter what, all of them will display from A to D on a form. What if i want to only display A and B based on the form they are on? Then C and D will display on a different form?
When I say form I mean one form will be for customers to fill out and the other will be from the admin panel just like we have ticket.php in root folder and then we have new_ticket.php in admin folder.
Thank for any help!
Display only certain custom fields?
Moderator: mkoch227
Re: Display only certain custom fields?
You would have to manually modify the forms to achieve that. Don't forget to backup first.
For example in index.php find (twice) and change it to something like
This should not print out fields named "Custom field 1" and "Custom field 2". Names must exactly match names of your custom fields.
Or if you prefer to use custom field numbers (maybe better - this way if you change name it still won't show 1st and 3rd custom field):
Also make sure these fields aren't required or the customer would be getting a "required fields missing" error.
For example in index.php find
Code: Select all
$v['use']
Code: Select all
$v['use'] && ! in_array($v['name'], array('Custom field 1','Custom filed 3') )
Or if you prefer to use custom field numbers (maybe better - this way if you change name it still won't show 1st and 3rd custom field):
Code: Select all
$v['use'] && ! in_array($k, array('custom1','custom3') )
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Display only certain custom fields?
Great Klemen! Thank you very much for the quick reply!
I'll let you know if I bump into any problems but sounds pretty straight forward!
Thanks
I'll let you know if I bump into any problems but sounds pretty straight forward!
Thanks