phannh Posted August 29, 2017 Share Posted August 29, 2017 Hi all, I created a client custom field like this In page source, i seen https://prnt.sc/ge9z82 So i have a question, how i can set up drop down custom field that option values contain characters before | symbol only. In this example, it will be server14b124 and server65412 My desire result http://prntscr.com/gea1mo Thank you. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 29, 2017 Share Posted August 29, 2017 I would have thought this would be better as a product custom field rather than a client custom field - as client custom fields apply to the client and what happens if a client wants an account in each location?? I know the documentation says the above friendly names should work, but frankly I don't know if the docs are out of date or the feature is bugged - if it were me, i'd just use 'server14b124,server65412b' (or whatever is applicable to your situation)in the custom field and use a Smarty replace in the template to display the friendly name.... that's just going to be one line of code in the template... and whilst you could do it as a hook, you'd end up manipulating the array and that's going to take more than one line of code! 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted August 29, 2017 WHMCS Developer Share Posted August 29, 2017 The output that you have here is by design. The full value of the selected item is saved, where only the "Friendly" value is displayed to the client and in the dropdown. It is not possible to change this as the full value would be need to be able to display the currently selected option. If you need to use the value elsewhere, there is a hook, CustomFieldSave, that you can use to grab the value and adjust it as you need - http://developers.whmcs.com/hooks-reference/everything-else/#customfieldsave I hope this helps you. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.