Update with simple javascript validation