Jump to content

Custom fields by registration


daronian

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated