1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Resolved radio button checked

Discussion in 'AMS Support' started by Robert9, Nov 15, 2019.

  1. Robert9

    Robert9 Member AMS Showcase Sportsbook

    In my AMS you have to choose some triggers that care for the behavior/design of the article.
    I tried different things, but i cant use a checked radio button; is there a solution for this?
    If you offer two radios with need to check one, it makes sense to have checked the one that is used most of times.
     
  2. Bob

    Bob Developer Staff Member

    Yes, AMS is highly configurable (one of the most configurable addons available). It has A LOT of Global Options and Per Category Options. All Radio buttons are set to the most commonly used settings.

    Please post a SCREEN SHOT of the radio button option(s) that you are referring to, along with information such as if you have made ANY customization(s) to the template (or programming code).

    At least 1 of the Radio buttons will be checked by default (and I set a default for all radio button options).

    As already mentioned, please post a screen shot of the specific option(s) that you are referring to.
     
  3. Robert9

    Robert9 Member AMS Showcase Sportsbook

    It is a clean AMS,
    there is nothing changed.
    It is an article field:

    ID: short
    Titel: Detailed page?
    Self placement
    Used in all cats
    Type: Radio
    Choices:
    1 no
    0 yes

    Field is needed
    All groups

    I dont know where to say: use 0 or 1 as default.

    In the add form, none of both is checked.
    This radios are a trigger only for template styling; they should not be shown, just set to 0 or 1; and the default should be zero.


    -----------------
    I try now a checkbox:

    Test, test, self placement, all cats, checkbox
    1 Checked

    Needed


    This is not usable without a checked box;
    if i add two values, i have two checkboxes.
    But i need one box with 0/1 value if unchecked, checked.



    Solution is to use it "not needed"; then we do nothing for default value, i guess it is 0 or NULL; and then we can set it to 1, if we need it.

    If i need 1 as default (checked); i dont know how to.
     
    Last edited: Nov 16, 2019
  4. Bob

    Bob Developer Staff Member

    All of my addons use the Core XenForo Custom Fields system to add Custom Fields functionality to them, so all Custom Field Type behaviors are controlled by Core XenForo.

    AMS does not change the behavior of ANY of the custom field types listed below:

    Selection_945.png

    The field type "Radio buttons" is a Core XenForo custom field type (it behaves the same in Custom User Fields, Custom Thread Fields, Custom Resource Fields and Custom Media Fields (as well as all my addons that implement the Core XF Custom Fields System).

    AMS is not changing the behavior of the Radio buttons field type, nor does it control the behavior in any way.

    The default behavior when using the Field type "Radio buttons" is to set the "No selection" as the default checked (as the field is NOT required, so its default checked to No Selection and the No selection allows the field to be UNSET).

    Selection_946.png

    If you check the General options >> "Field is required", then the "No selection" is removed and there is no default checked option (again, this is core XF behavior, not AMS controlled). My guess is that they designed it to force the user to have to make a choice on their own (since its a required field).

    Selection_947.png

    Again, this is not something that AMS controls, its how the core xf custom fields system is designed to behave.

    Note: the above examples from from Custom Thread Fields (so that you can see that its not an AMS thing, its how they designed the behavior).

    As for the field type "Check boxes", there is no default checked option. That is how the Core XenForo developers designed it.

    You'd have to modify the Core XF Custom Fields system to change this behavior (and it would effect Core XF, Core Addons and all 3rd party addons that implement the core xf custom fields system).

    You also have the option of extending the Custom Fields system to add your OWN field types that behave like YOU want them to ;)
     
  5. Robert9

    Robert9 Member AMS Showcase Sportsbook

    Not needed;
    1 => Yes

    should do it. Thank you very much.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.