How to only accept values from visible fields and ignore the hidden ones?