[Skip to main content](#vessel-content)

#   Registration Custom Fields Depend On Checkbox

##

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago [\#26645](#26645) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  *[Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26645 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")* was created by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")*

Hello again.
After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate.
The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).

How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?

Thanks in advance!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#26657](#26657) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26657 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Hi,

What you should do is to edit file "registration" of the view "user" via the menu Display-&gt;Views. There, you could add some javascript to hide/display the custom fields area based on the value of that affiliate checkbox. The only limitation you will have with this method is that your custom fields can't be required. You will also need to know PHP and javascript to do that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago [\#26659](#26659) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26659 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Ok thats good, but i must have them required.. other wise there is no use..
How can i require those fields?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#26675](#26675) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26675 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

That won't be possible with the required option of the custom fields as there are protections in the fields system so that the users cannot tamper with the fields.

You would have to leave then not required in HikaShop and add some more customization in the file "step" of the view "checkout" so that when the user clicks on the next button, you check with some javascript that the fields are not empty.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago -  15 years 1 month ago [\#26735](#26735) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26735 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Done all but one thig.. i cant seem to get them invisible or visable depend on checkbox..
I have done this:

&lt;script language="text/javascript"&gt;
function showhidefield()
{
if (document.'hikashop_checkout_form.hikashop_affiliate_checkbox.checked)
{
document.getElementById("hideablearea").style.display = "block";
}
else
{
document.getElementById("hideablearea").style.display = "none";
}
}
&lt;/script&gt;

this is in the header.

and i have the manual fields coverd in div hideablearea:

&lt;div id='hideablearea' style='display:none'&gt;
&lt;tr class="hikashop_registration_placement_line"&gt;
...
&lt;span class="hikashop_field_required"&gt;*&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/div&gt;

And i add the onclick for the checkbox:

&lt;input class="hikashop_affiliate_checkbox" id="hikashop_affiliate_checkbox" type="checkbox" name="hikashop_affiliate_checkbox" onclick="showhidefield()" value="1" &lt;?php echo $this-&gt;affiliate_checked; ?&gt; /&gt;&lt;/span&gt;

Do you have any idea why that wont work?
Thanks alot!

Last edit: 15 years 1 month ago by [bars92](/forum/user/3048-bars92 "View bars92's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#26753](#26753) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26753 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

You have :
document.'hikashop_checkout_form.hikashop_affiliate_checkbox.checked

instead of:
document.hikashop_checkout_form.hikashop_affiliate_checkbox.checked
in your function.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago [\#26791](#26791) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26791 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Thanks,but still no use.. the function is not called at all.. the onclick is not working for some reason..

Any suggestions?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#26817](#26817) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26817 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

That sounds ok though.
Do you have a link to that page ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago -  15 years 1 month ago [\#26998](#26998) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#26998 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Well i changed the code to that:

&lt;script type="text/javascript"&gt;
function showhidefield()
{

if (document.hikashop_registration_form.hikashop_affiliate_checkbox.checked)
{
alert("Checked True");
document.getElementById("hideablearea").style.display = "block";
}
else
{
document.getElementById("hideablearea").style.display = "none";
}
}
&lt;/script&gt;

and now i get in the alert but nothing happens..
Here is a link: **** .

EDIT: Never mind, i fixed it. Apprently the div was not displayed right, so the function couldnt hide the non-exsisting div.

Thank you for you help!

Last edit: 15 years 1 month ago by [bars92](/forum/user/3048-bars92 "View bars92's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago -  15 years 1 month ago [\#27052](#27052) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27052 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

After the changes i made i ran into a bug.
Once i complete the registration the address is not been saved..
I added 2 inputs as it appear in the front page (&lt;tr&gt;&lt;td&gt;&lt;lable&gt;....)
and added a visible/invisible divs.
OnClick disable all the hideableareaX divs.
the 2 inputs are not required in Hikashop config.
When i remove my custom part, the registration is working fine.

Could you tell me what made Hikashop not save the address?

Code:

&lt;tr class="hikashop_registration_placement_line"&gt;
&lt;?php
$lang =&amp; JFactory::getLanguage();

?&gt;
&lt;td class="key"&gt;
&lt;div id='hideablearea0' &gt;
&lt;label for="user_placement"&gt;&lt;?php if($lang-&gt;getName() == 'Hebrew'){echo "מקום";}else{echo "Placement";}?&gt;&lt;/label&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;div id='hideablearea1'&gt;
&lt;input id="user_placement" class="inputbox" type="text" value="" name="data[user][user_placement]"&gt;
&lt;span class="hikashop_field_required"&gt;*&lt;/span&gt;

&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt; &lt;tr&gt;&lt;td colspan="2"&gt;&lt;div id='hideablearea2' &gt;&lt;?php echo '&lt;br /&gt;' . JText::_('HIKA_PLACEMENT_EXPLAIN');?&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;

&lt;tr class="hikashop_registration_position_line"&gt;
&lt;td class="key"&gt;
&lt;div id='hideablearea3'&gt;
&lt;label for="position"&gt;&lt;?php if($lang-&gt;getName() == 'Hebrew'){echo "עמדה";}else{echo "Position";}?&gt;&lt;/label&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;div id='hideablearea4' &gt;
&lt;select id="position" size="1" name="data[user][position]"&gt;
&lt;option id="position_Left" selected="selected" value="Left"&gt;&lt;?php if($lang-&gt;getName() == 'Hebrew'){echo "שמאל";}else{echo "Left";}?&gt;&lt;/option&gt;
&lt;option id="position_Right" value="Right"&gt;&lt;?php if($lang-&gt;getName() == 'Hebrew'){echo "ימין";}else{echo "Right";}?&gt;&lt;/option&gt;
&lt;/select&gt;
&lt;span class="hikashop_field_required"&gt;*&lt;/span&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan="2"&gt;&lt;div id='hideablearea5' &gt; &lt;?php echo '&lt;br /&gt;' . JText::_('HIKA_POSITION_EXPLAIN');?&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

Last edit: 15 years 1 month ago by [bars92](/forum/user/3048-bars92 "View bars92's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#27059](#27059) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27059 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Your fields have the name data[user][position]
But you're talking about the address not being saved.
If your custom fields are address custom fields, you should have the name data[address][position] instead.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago [\#27068](#27068) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27068 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Custom fields have no connection to address.
Both costum fields are user fields.
The bug is that somehow the address is not been saved..

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#27069](#27069) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27069 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Then I don't know as I don't see any problem in the code you posted. Did you modify other things ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago -  15 years 1 month ago [\#27070](#27070) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27070 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

No, did not add anything else.
When i remove the code above, it's working again, but when i add it back it's not saving the address.

I can't find the connection..

EDIT: I just found out it does save nothing but the email, full name and user name.. maybe that can help.

Last edit: 15 years 1 month ago by [bars92](/forum/user/3048-bars92 "View bars92's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#27071](#27071) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27071 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

I don't see the problem.

You say you didn't add anything else, but I suppose that you added some JS code right ? Maybe it comes from the js ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago [\#27083](#27083) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27083 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Yes, i added JS at the header of all pages:

&lt;script type="text/javascript"&gt;
function showhidefield()
{

if (document.hikashop_checkout_form.hikashop_affiliate_checkbox.checked)
{
document.getElementById("hideablearea0").style.display = "block";
document.getElementById("hideablearea1").style.display = "block";
document.getElementById("hideablearea2").style.display = "block";
document.getElementById("hideablearea3").style.display = "block";
document.getElementById("hideablearea4").style.display = "block";
document.getElementById("hideablearea5").style.display = "block";
}
else
{
document.getElementById("hideablearea0").style.display = "none";
document.getElementById("hideablearea1").style.display = "none";
document.getElementById("hideablearea2").style.display = "none";
document.getElementById("hideablearea3").style.display = "none";
document.getElementById("hideablearea4").style.display = "none";
document.getElementById("hideablearea5").style.display = "none";
}
}
&lt;/script&gt;

I don't think it might me the problem..

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14307
-
-

15 years 1 month ago [\#27136](#27136) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27136 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Did you create custom fields with the column names user_placement and position for the table user ?
Otherwise, that might create such problem as the field data would be missing.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bars92](/forum/user/3048-bars92 "View bars92's Profile")**
- [![bars92's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3048-bars92 "View bars92's Profile") Topic Author
- [ Offline](/forum/user/3048-bars92)

Less More

- Posts: 108
- Thank you received: 2
-
-

15 years 1 month ago [\#27138](#27138) by [bars92](/forum/user/3048-bars92 "View bars92's Profile")  Replied by *[bars92](/forum/user/3048-bars92 "View bars92's Profile")* on topic *[Re: Registration Custom Fields Depend On Checkbox](/forum/4-how-to/26645-registration-custom-fields-depend-on-checkbox#27138 "Hello again. After i bought my second copy i need in that website to have at registration 2 options: register as a shopper or register as a affiliate. The affiliate box is handling that, but i need to add fields when someone is requesting to sign as affiliate (custom fields).  How can i have when the checkbox is clicked, some fields will be displayed and when is off they will be hidden and unavaliable?  Thanks in advance!")*

Aha! I named them placement and position without the user_ before so i removed the [user] before the input and it's working now.
I dont know why did it displayed with [user] before when i copied it..

Thanks again ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI2NjQ1LXJlZ2lzdHJhdGlvbi1jdXN0b20tZmllbGRzLWRlcGVuZC1vbi1jaGVja2JveD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.109 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
