Forums / Setting Up Categories, Products, Attributes / Radio Buttons on Attributes

Radio Buttons on Attributes

Views: 1,862

Results 1 to 7 of 7
19 May 2011, 3:42 PM
#1
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Radio Buttons on Attributes

in

http://www.zen-cart.com/forum/showthread.php?t=69217&highlight=Attribute+Required+Text&page=5 on 12 Aug 2010 in a question relating to making an attribute 'rerquired' with attribute type 'radio' Ajeh says the only way is to have an extra button.

Yes - I have the extra button and all works well.

However I feel the presence of the button image next to the 'extra' entry is confusing.

Is there any way using CSS or the flexible attributes addon to hide the button image on the first entry. Perhaps by making the first entry (and only the first entry) use a user defined image instead of the standard button image?

19 May 2011, 8:12 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Radio Buttons on Attributes

Add to your stylesheet

#attrib-5-3, #attrib-5-3+label {display: none;}

This is independent of Flexible Attributes, and will work even if you don't have it installed.

20 May 2011, 8:01 AM
#3
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Re: Radio Buttons on Attributes

:clap::clap:
Absolutely brilliant - I only wanted to loose the button image not the text as well so I used

#attrib-5-3 {display: none;}

Many Many Thanks:bigups:

20 May 2011, 4:07 PM
#4
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Re: Radio Buttons on Attributes

Thats great - now on a similar theme.
Can anyone please tel me how can I get the radio buttons to appear on the same line.
I have the Flexible attributes module loaded.

I know I can hack attributes.php and edit out the line break at the end of a row, however this can split the button from the label. It also wraps all the way back under the attibute name.

This intended to replace a mandatory text attibute which needs a date and as I have no way of checking that the customer chooses one of the dates available, or even enters a valid date, this is not ideal.
There are 17 possible dates. I could use a drop down but that does not support 'required', so instead I thought to use radio buttons, 3 or 4 to a row depends on how it looks.

If you take a look at http://www.freight-stop-shop.co.uk/tickets/index.php?main_page=product_info&cPath=9&products_id=83 you will see the problem for 'Available dates'.

Note the 'Please Select' has the button hidden as advised.

20 May 2011, 8:48 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Radio Buttons on Attributes

Flexible Attributes is built to allow this kind of layout. The readme describes some of the possibilities, as does the sample stylesheet. I can't take time right now to help more, but will check back when I can.

21 May 2011, 9:11 AM
#6
tsrplatelayer avatar

tsrplatelayer

Zen Follower

Join Date:
Oct 2010
Location:
Shropshire
Posts:
177
Plugin Contributions:
0

Re: Radio Buttons on Attributes

cheers - although I confess I dont fully understand the compexities of CSS, beyond simple '.' and '#'. Once you start chaining these together I am somewhat confused.

I will have ago, and post on the Flexible Attributes support should (when:unsure:) I get stuck

29 Feb 2012, 6:07 PM
#7
stardust_2 avatar

stardust_2

New Zenner

Join Date:
Oct 2009
Location:
Tennessee
Posts:
8
Plugin Contributions:
0

Re: Radio Buttons on Attributes

gjh42:

Add to your stylesheet #attrib-5-3, #attrib-5-3+label {display: none;}

Is there anyway you can turn display off for all labels or radio buttons associated with the 5 or say all option value ID from 3 to 15 or do you have to assign for every one.

Does that make sense?