N
N
Nick Bukovskiy2017-09-13 18:09:57
JavaScript
Nick Bukovskiy, 2017-09-13 18:09:57

How to exclude repetitions from one array?

I am writing a project on laravel and there is such a task:
Form, 2 fields with a choice of several categories. There is only one category array.
How can I make it so that when a category is selected in the first field - in the second field, this category is hidden from the selection.

Perhaps there are laravel solutions or js examples
I would be glad for any help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kulaeff, 2017-09-13
@sonterix

Something like this https://jsfiddle.net/62ajfx1b/.
You can use attr('disabled', true) instead of css('display', 'none')

M
Maxim Timofeev, 2017-09-13
@webinar

laravel is backend. Your task is frontend. Therefore it is natural - js.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question