Given the following HTML
<div><input type="checkbox" value="sushi" name="restaurant_categories[]"> Sushi</div>
<div><input type="checkbox" value="pizza" name="restaurant_categories[]"> Pizza</div>
<div><input type="checkbox" value="italian" name="restaurant_categories[]"> Italiaans</div>
<div><input type="checkbox" value="kebab" name="restaurant_categories[]"> Kebab</div>
I am trying to retrieve the selected checkbox-values. In PHP I'd just do $_POST["restaurant_categories[]"].
I tried the following in Actix/web:
#[derive(Deserialize)]
pub struct AddRestaurantForm {
//...
pub restaurant_categories: std::vec::Vec<String>,
}
But that gives the runtime error: Parse error: missing field `restaurant_categories`.
.
How would I solve this?