S
S
Sergiy Motchany2019-12-16 06:21:16
MODX
Sergiy Motchany, 2019-12-16 06:21:16

How to pass value from radio or checkbox in modx revo ajaxform?

Good day to all.
How to pass value from radio or checkbox in modx revo ajaxform?
For some reason, I always get the latest value anyway.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mikhail Prokhorov, 2019-12-16
@pro6ka

Check the form fields. Most likely they have the same name

D
Dmitry, 2019-12-17
@i__dmitry

Does the name attribute have square brackets? To pass an array of data from checkboxes, the field should look like this:
<input type="checkbox" name="check[]" value="">

B
bochkarev, 2019-12-27
@bochkarev

Check out this guide: format Checkbox

<label>Color: </label>
<input type="checkbox" name="color[]" value="blue"  > Синий
<input type="checkbox" name="color[]" value="red"  > Красный
<input type="checkbox" name="color[]" value="green"  > Зеленый

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question