-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional Logic for Custom Fields #3779
Comments
You could simplify the code in You could also simplify your JavaScript by using jQuery. I know some people don't like using jQuery, but as the library is loaded anyway you might as well use it.
I don't know what's causing this. You'll need to see what's happening by looking at the CSS and layout using your browser's developer tools.
You can change the field order by using the config setting |
I don't know how you've generated the three extra fields (Chair Qty etc.), but you'd be better off just letting them each be their own field, rather than part of another one. That way they'll appear in a vertical column and you won't have that big gap. It'll also work better on a narrow screen such as a smart phone. |
Thanks Campbell. I've been trying to play around without overriding the original method MRBS was designed to deal with custom fields, but to no avail, I haven't made it work. I've managed to display the requirements (chairs, tables and internet) vertically by doing some revisions in the get_field_custom. I'll post the code and the screenshot for your reference. code:
} $full_class = NAMESPACE . "\Form\$class"; $field->setLabel(get_loc_field_name(_tbl('entry'), $key)) if ($custom_field['nature'] == 'decimal') if ($class == 'FieldTextarea') /------------implement terms and conditions ------------/
} Issue: The location of the terms and conditions You help is very much appreciated. TIA |
I don't know. You need to look at the HTML structure in your developer tools. It looks like the terms and conditions field is a level too low. I still think there's no need for you to have any code for the chairs etc. MRBS should just do it all automatically. |
Thanks for your patience Campbell. I got what I want now. I created the radio buttons within the get_field_custom function instead of creating them through a function (get_field_logistics_toggle()). |
Hi, I added three custom fields (req_chair, req_table, req_internet), following my previous javascript pattern, I managed to hide and display the added custom fields. Here's what I did:
Upon loading the input boxes and the checkbox are hidden.
The issue is the gap between the textarea and the radio button
The hide/display functions of the radio is working well.
Would it be possible that the two input boxes and the checkbox below the radio buttons or beside the radio buttons?
Here's what I got so far:
Radio buttons
TIA for your usual help.
The text was updated successfully, but these errors were encountered: