-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only one live error message shows at a time, for validation on sign-up page #12
Comments
Oh, or does |
Okay, just tested replacing the empty string in |
(Going to leave this for now, feel free to take a look 😃) |
Thanks @lyneca 👍 |
Calls to |
I don't know much about the code, but does |
Ooh thank you about I think so far it's been only one error field at a time that changes so it looks like |
I have an idea for this, working on it now 😃 |
Removed the repeated lines that were setting all tags with `class=error` to have blank text each time a blur event was triggered. Then added lines to set the tags with `class=error` to have blank text if the field was valid, in each of the validation funcs. #12
I'm just gonna take a look at this that Luke said earlier 😃 |
Hmm it seems just to get one parent element? 🤔 I just had a quick check here https://api.jquery.com/parent/ |
Oh, okay I see that |
The hierarchy for the signup page is like this: So from the jQuery API, it looks like that this — gets the parent of the input element that's stored in the I didn't know that before 😊 |
Example: If you type a username that's too short, you get an error message as soon as you leave the field. Then if you move onto the nickname field and type a nickname that's too short and lose focus on the field, you get an error message for the nickname too.
Expected behaviour: both error messages should stay since they're relevant still.
What happens: the error message for the username disappears while the error message for nickname is still there.
I think it has something to do with when we make .text('error message etc ') appear in the
<p>
's withclass="error"
— I don't know if it affects<p>
's that have already had their text changed or if it makes them blank.Here is part of the code for the username field:
Also I don't think having this repeated at the start of every blur event is a good idea hehe, it also might be affecting things:
I'm not quite sure what the second line does 😊 does it find a new tag with
class="error"
each time? Anyway, just recording some ideas :)The text was updated successfully, but these errors were encountered: