daronian Posted October 5, 2016 Share Posted October 5, 2016 Hello! First of all I would like to apologize if it's the wrong forum-section. I am having one big problem with Registartion Form (which is located here: http://www.strona.jchost.pl/client-area/?whmpca=register). I added Custom Field (DropDownList) named "Status Prawny" (legal status in Polish) using WHMCS Admin Panel. And there you can choose between two fields: - "Firma" (a company in Polish), - "Osoba" (a person in Polish). Now I would like to have another custom fields that will show up only when one of these fields (Firma/Osoba) is chosen. E.g. When someone choose "Firma", then he will be able to see and fill in the new field "VAT number", but when he choose "Osoba" then he will be able to see (and fill in) the new field "ID number" or something (and not VAT number) etc. Do you understand what I mean, guys? And do you maybe know the solution? Kind regards! 0 Quote Link to comment Share on other sites More sharing options...
twhiting9275 Posted October 6, 2016 Share Posted October 6, 2016 This is likely going to take some custom template work, with javascript Take a look through templates/templatename/register.tpl . Find the code {if $customfields} {foreach from=$customfields key=num item=customfield} <div class="form-group"> <label class="control-label" for="customfield{$customfield.id}">{$customfield.name}</label> <div class="control"> {$customfield.input} {$customfield.description} </div> </div> {/foreach} {/if} Tweak this as needed. You'll likely need to incorporate a bit of javascript as well. Keep in mind that you will need to make sure the 'VAT number' field is not required. Otherwise, you'll have issues with registration 0 Quote Link to comment Share on other sites More sharing options...
daronian Posted October 9, 2016 Author Share Posted October 9, 2016 Thank you for your answer! I have also contacted WHMCS support and they told me that something like this is unavailable at the moment and that I shouldn't add functions like this one. So now I have just one field which is "ID number/VAT number" with the information which one should the client use (in which situation etc). I hope the clients will understand ) Thank you twhiting9275! 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 9, 2016 Share Posted October 9, 2016 JavaScript and/or Actionhooks can be used to accomplish this validation, it has been done before 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.