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

#   Radiolist to checkbox?

##

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 8 months ago -  10 years 8 months ago [\#230413](#230413) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230413 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")* was created by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")*

Hi,

I am looking to have simple checkbox on checkout login view.
I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:
Code:

&lt;div class="checkout-switcher"&gt; &lt;?php $values = array(); $v = null; $v = JHTML::_('select.option', 2, JText::_('GUEST').'&lt;br/&gt;'); $v-&gt;class = 'hikabtn-checkout-guest'; $values[] = $v; $v = JHTML::_('select.option', 3, JText::_('HIKA_REGISTRATION').'&lt;br/&gt;'); $v-&gt;class = 'hikabtn-checkout-simplified-pwd'; $values[] = $v; $defaultSelection = '3'; echo JHTML::_('hikaselect.radiolist', $values, 'data[register][registration_method]', ' onchange="displayRegistration(this)"', 'value', 'text', $defaultSelection, false, false, true ); ?&gt; &lt;/div&gt;

It works and is switching between registration and guest... However what i am looking to have is simple checkbox.
If checked it should switch to registration and back to guest if not.
Is there a way to change this code to checkbox?

I also tried to do what i need with custom field checkbox but it seems there is no way...

Regards

Last edit: 10 years 8 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MjM5My1yYWRpb2xpc3QtdG8tY2hlY2tib3g/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 8 months ago [\#230445](#230445) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230445 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

I don't see why you would use checkboxes for the switcher ?
It would mean that people could select several login/registration modes at the same time.
But if you select for example login, there is no need to select registration, and vice versa.
That's why it's actually made with radio buttons by default so that you can only select one of the options of the switcher.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 8 months ago -  10 years 8 months ago [\#230485](#230485) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230485 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

I would like to configure like this. Left side login, right side guest or register it depends on switcher....
So if you would check code i added only registration and guest radio. I need checkbox to have this. Left side login anr right side guest with checkbox would you like to register? If checked it would display registration. Simplified reg with password.
So if you could tell me how to change radio to checkbox i would be very greatful.

I added something like this:
Code:

echo '&lt;input type="checkbox" name="data[register][registration_method]" id="data[register][registration_method]" checked="checked" value="3" onchange="displayRegistration(this)" /&gt;';

But it works only when checked.. How to call back guest view then unchecked?

Thanks

Last edit: 10 years 8 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 8 months ago [\#230556](#230556) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230556 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

So after some time I did what I need. I have added this to registration/view file under email field:
Code:

&lt;?php $values = array(); $v = null; $v = JHTML::_('select.option', 2, JText::_('GUEST').'&lt;br/&gt;'); $v-&gt;class = 'hikabtn-checkout-guest'; $values[] = $v; $v = JHTML::_('select.option', 3, JText::_('HIKA_REGISTRATION').'&lt;br/&gt;'); $v-&gt;class = 'hikabtn-checkout-simplified-pwd'; $values[] = $v; $defaultSelection = '2'; echo'&lt;input type="checkbox" class="hika_check_box" name="data[register][registration_method]" id="hika-box" value="3"/&gt;'; ?&gt;

And this in my template js file:
Code:

$(document).ready(function(){ $('#hika-box').change(function(){ if($(this).attr("checked")) { displayRegistration(this); } else { var guest = { value: '2', checked: '1' }; displayRegistration(guest); } }); });

Just thinking now is this correct way or not?

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MjM5My1yYWRpb2xpc3QtdG8tY2hlY2tib3g/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 8 months ago [\#230583](#230583) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230583 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

Yes, that's great !
Thank you for sharing your solution with the community.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 8 months ago -  10 years 8 months ago [\#230661](#230661) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230661 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

So after i have done css customization i found that it is not working, lol ![:(](/media/kunena/emoticons/22.png ":(")
It is asking password on guest...My checkbox only changes view from guest to registration and nothing more...
Applying original code with radiolist all works ok.

Tried a lot things but it seems i am missing something.

If you Nicolas could help me i would be really greatful cause i stuck with it.

Regards

Last edit: 10 years 8 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MjM5My1yYWRpb2xpc3QtdG8tY2hlY2tib3g/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 8 months ago [\#230676](#230676) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230676 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

The code you placed in your previous message looks good to me. Can you give a link to the page so that we can see what it does ?

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 8 months ago -  10 years 8 months ago [\#230713](#230713) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230713 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

You can try it here: [ kyra.lt/demo](http://kyra.lt/demo) just add something to cart and process to checkout. Enter any email on guest and it will ask password even checkbox isn't checked....

I also tried to remove this code to see if it makes difference and nothing, it makes no difference...: Code:

$values = array(); $v = null; $v = JHTML::_('select.option', 2, JText::_('GUEST').'&lt;br/&gt;'); $v-&gt;class = 'hikabtn-checkout-guest'; $values[] = $v; $v = JHTML::_('select.option', 3, JText::_('HIKA_REGISTRATION').'&lt;br/&gt;'); $v-&gt;class = 'hikabtn-checkout-simplified-pwd'; $values[] = $v; $defaultSelection = '2';

But this code does all the job....

Thank you

Last edit: 10 years 8 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MjM5My1yYWRpb2xpc3QtdG8tY2hlY2tib3g/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 8 months ago [\#230735](#230735) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230735 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

I see that you've just added some display:none; CSS on the password fields...
So it's normal that it refuses the form.
The Checkout will only accept the registration modes that are selected in the HikaShop configuration "registration" option. So there, you need to make sure that you have both the simplified registration and the guest selected.
You'll probably have to modify the file "checkout" of the view "config" for your backend template for that.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 8 months ago [\#230797](#230797) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[Radiolist to checkbox?](/forum/4-how-to/882393-radiolist-to-checkbox#230797 "Hi,  I am looking to have simple checkbox on checkout login view. I turned on switcher and modified checkout login/view file and added this code to registration view file under email field:  It works and is switching between registration and guest... However what i am looking to have is simple checkbox. If checked it should switch to registration and back to guest if not. Is there a way to change this code to checkbox?  I also tried to do what i need with custom field checkbox but it seems there is no way...  Regards")*

Hi,

So I found I couldn't do it by my self so I have contacted @kishoreweblabs as usual and he did what I need.
Changed my js file code to this and it works:
Code:

$(document).ready(function(){ // displayRegistration(guest); var registration_method_name='data[register][registration_method]'; SelectdValue=2; $('input[name="' + registration_method_name+ '"][value="' + SelectdValue + '"]').prop('checked', true); $('input[name="' + registration_method_name+ '"][value="' + SelectdValue + '"]').trigger('change'); $('#hika-box').click(function(){ if($(this).attr("checked")) { SelectdValue=3; $('input[name="' + registration_method_name+ '"][value="' + SelectdValue + '"]').prop('checked', true); $('input[name="' + registration_method_name+ '"][value="' + SelectdValue + '"]').trigger('change'); }else{ SelectdValue=2; $('input[name="' + registration_method_name+ '"][value="' + SelectdValue + '"]').prop('checked', true); $('input[name="' + registration_method_name+ '"][value="' + SelectdValue + '"]').trigger('change'); } }); });

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4MjM5My1yYWRpb2xpc3QtdG8tY2hlY2tib3g/dG1wbD1tYXJrZG93bg==) 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.082 seconds

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