How to make a radio button using MIGX extra for ModX Revolution - modx-revolution

It doesn't look like there's much information on this out there. I'm having trouble creating a MIGX template variable in ModX Revolution that includes a radio button array (if one is selected, then the others aren't). Here's what I got so far:
[{"caption":"Info", "fields": [
{"field":"name","caption":"Name"},
{"field":"description","caption":"Description", "inputTVtype":"richtext"},
{"field":"price","caption":"Price"},
{"field":"ticket_status","caption":"Ticket Status","inputTVtype":"radio","inputOptionValues":"On Sale==onsale||Off Sale==offsale||Sold Out==soldout"}
]}
]
So the end result should look like:
Name:
Description:(text editor)
Price:
Ticket Status:
radio button for On Sale
radio button for Off Sale
radio button for Sold Out
(only one should be able to be selected at a time)
Is this possible? How?
Thanks

For ticket_status use this "inputTVtype":"option" instead "inputTVtype":"radio".

Related

How to increase the product price in Snipcart with checkbox

I have been implementing the Snipcart in my website and I want to prompt the user with checkbox, and depending on whether the user checked it or not to increase a price of a product.
Here is my code:
<button
class="snipcart-add-item btn btn-primary"
[attr.data-item-id]="selectedService._id"
[attr.data-item-price]="mainPrice"
data-item-url="http://localhost:4200/"
[attr.data-item-description]="selectedService.jsonData.description.en"
[attr.data-item-name]="selectedService.name"
data-item-custom1-name="Number of additional employees"
data-item-custom1-options="0|1[+25.00]|2[+50.00]|3[+75.00]|4[+100.00]|5[+125.00]|6[+150.00]|7[+175.00]|8[+200.00]|9[+225.00]|10[+250.00]"
data-item-custom2-name="Procure employment pass for USD 1,650.00 to allow a foreigner to serve as the local director."
data-item-custom2-options="false|true[+1650.00]"
>
In your Docs, it says that if the values of "data-item-options" are "true|false", then it will be displayed as a checkbox, but it is displayed as a dropdown list with values "true" and "'false". Am I doing something wrong and is there some other way to implement this?
Also I have tried to use "data-item-custom-type"="checkbox", but then I don't have the option to increase the value of product price (or maybe I just didn't find how to do that).
Checkboxes don't support price modifiers yet, this is something our team will implement in the future though.
For now, we suggest you use a dropdown for this:
data-item-custom2-options="No|Yes[+1650.00]"

validating checkbox checked in Orbeon FormBuilder

How do I validate a checkbox in FormBuilder? I'm looking for something like checkbox.isAny. I'm working on very complex branching on a survey form. If any are boxes are checked, I will show another question in a survey, and so on.
Right now, my formula is looking for checkbox1 or checkbox2 or checkbox3. That works when any 1 checkbox is checked. But when checkbox1 AND checkbox2 is checked the next question does not appear. There must be a way to check for any boxes.
I'm new, so if you can point me to a wiki or online learning source for xforms validation and xpath, I'd greatly appreciate it.
Thank you
If you want to show a question (say named question) if any of the checkboxes for a field (say named checkboxes) is checked, maybe because if any of the checkboxes is set users need to provide more information, then set the Visibility for question to:
$checkboxes != ''

orbeon forms - Dynamic Dropdown remove value

I’m using Oberon forms version 2019.2 CE.
In my form I have Dynamic Dropdown (with search) with country select (required field) and Text field with display code of selected country:
When I select country, in text field appears selected country code:
Now I can click ‘x’ sign to remove value form drop down:
Value in field 'code' has not been deleted. When I click Validate button no error is detected. It seems that when I use 'x' sign to remove value from dropdown, I remove only label, not value.
My question is whether it is possible to remove both label and value, when I click 'x' sign?
I am unable to reproduce this with Orbeon Forms CE 2019.2. This is what I am seeing when running this form. If this doesn't help, I'd recommend you update your question to include a link to a minimal form that you are using to reproduce this, with steps to reproduce (and then post a comment, for notification).
It looks like the problem occurs when I use ‘Service performs search’ option set to ‘Yes’. Below you can see how it looks like in my form:
Source code of the form: here

Need to update HABTM checkboxes based on a select menu

In my rails 3.1 app, I have a Timesheet model. A Timesheet belongs to a Track. A Track has many TimingEyes.
When I create a new Timesheet and select its Track (via a select menu), I need to dynamically display a group of checkboxes for choosing Timing Eyes that were activated that day. At the moment I can display all the timing eyes available in my database, however there are a dozen tracks each with several timing eyes. This is way too much information on the new Timesheet form.
Is there a way I can limit the group of Timing Eyes to the track_id chosen in my select menu? Would there be an advantage to making this a multistep form?
Multi step form wouldn't be a bad thing here and would remove complexity... if you want to stay with a single page form though, this sounds like a great time for some jquery.
Use .change to fire whenever the select box changes value.
When this fires use .get (ajax) to render your "checkbox" section html.
So a basic boilerplate would look something like this:
$("#trackselect").change(function () {
$.get('yoururl', function(data) {
$('#checkboxsection').html(data);
});
})
With this setup you need to define a url/page that outputs the checkboxes html for that particular track. Maybe something like (http://yourdomain.com/tracks/:id/checkboxes).
Hope this helps

Rails: many-to-one display on form via dynamically added input text boxes

I have a form in rails that allows the user to create a new object (call it a search).
This object has_many excluded_phrases.
What I would like is the ability to display one text box per excluded phrase added.
The form will start out with only a single text box, allowing the user to add one excluded phrase. If they want to add more, there will be button labeled "+" that will dynamically add one more text box, and allow the user to add as many more items as he wants.
On form submit, this should populate the db with the user search, and create all the required phrases that are linked to that user search.
Help?
All inspiration needed is there:
http://railscasts.com/episodes/197-nested-model-form-part-2
This popular rails plugin does exactly what you want.

Resources