Fixed company edit form.

main
Josef Rokos 2 years ago
parent bbad2bb183
commit a2a4c551b4

@ -41,7 +41,7 @@ pub fn CompanyEdit(
id="nameWithTitle"
class="form-control"
placeholder="Enter Name"
value={move || company.get().name}
prop:value={move || company.get().name}
name="company[name]"
/>
</div>
@ -54,7 +54,7 @@ pub fn CompanyEdit(
id="street"
class="form-control"
placeholder="Enter Street"
value={move || company.get().street}
prop:value={move || company.get().street}
name="company[street]"
/>
</div>
@ -65,7 +65,7 @@ pub fn CompanyEdit(
id="houseNumber"
class="form-control"
placeholder="Enter House number"
value={move || company.get().house_number}
prop:value={move || company.get().house_number}
name="company[house_number]"
/>
</div>
@ -78,7 +78,7 @@ pub fn CompanyEdit(
id="zip"
class="form-control"
placeholder="Enter ZIP code"
value={move || company.get().zip_code}
prop:value={move || company.get().zip_code}
name="company[zip_code]"
/>
</div>
@ -89,14 +89,15 @@ pub fn CompanyEdit(
id="city"
class="form-control"
placeholder="Enter City"
value={move || company.get().city}
prop:value={move || company.get().city}
name="company[city]"
/>
</div>
</div>
</ModalBody>
<ModalFooter>
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal" on:click=move |_| opener.hide()>
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal"
on:click=move |_| {validator.reset(); opener.hide()}>
{trl("Close")}
</button>
<button type="submit" class="btn btn-primary">

@ -58,4 +58,8 @@ impl Validator {
pub fn messages(&self) -> Option<Vec<String>> {
self.messages.get()
}
pub fn reset(&self) {
self.set_valid.update(|v| *v = true);
}
}
Loading…
Cancel
Save