-5

How to remove or hide product that i have already selected?

enter image description here

The product which is on select tag is coming from back-end.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    Pls read - https://stackoverflow.com/help/how-to-ask – Archit Gargi Mar 04 '22 at 11:58
  • selected product remove from the dropdown? when you comes again, the product is selected not shown? Is this your question?? please share complete question. – Khadim H. Mar 04 '22 at 12:02
  • 1
    Please learn how to take screenshots, and don't take pictures of the screen with a camera. – James Z Mar 04 '22 at 14:31
  • @khadimhr yes sir... If i select one particular product then next time as you seen in picture ,, when i click on drop-down the same product is showing in the list of products... So my point is if someone select one particular product then next time.. the same product is not shown in the list... Hope you understand my question... – Ritesh Singh Mar 05 '22 at 12:14
  • @ArchitGargi okay done ... Now give me some idea to solve my question... – Ritesh Singh Mar 05 '22 at 12:21
  • @RiteshSingh Of course I would if I knew how to – Archit Gargi Mar 05 '22 at 12:23
  • 1
    You should show your code or how you implement it, that would be easier for supporters to help you. – Nick Vu Mar 06 '22 at 06:49
  • @RiteshSingh , Dear go on this link, I hope you find a solution, how to hide, delete and shown products. https://stackoverflow.com/questions/375508/removing-an-item-from-a-select-box – Khadim H. Mar 07 '22 at 06:55

1 Answers1

0

You should filter your items that come from back end and then show them up in your list.
Create a field in your database as selected with default value of 0.
Update selected items to 1 or any other number then :

const result = items.filter(item=> item.selected != 0 );

Sajed
  • 1,797
  • 2
  • 7
  • 21
Steve
  • 1
  • 3