Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Conversation

@MohamadAlissa
Copy link

No description provided.

@MohamadAlissa MohamadAlissa changed the title Part 1 Solution_change jumbtron and the buttons background color Part 1&2 in Bike For Refugee Solution Jun 19, 2017
Copy link

@IsmaelMartinez IsmaelMartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job.

In this case, as the validation is small (even when adding the extras) doesn't really matter much if you run it twice.

If the validation functions get big, that could slow the process down.

js/homework.js Outdated
//submit function
function submitForm(event) {
event.preventDefault();
checkEmail();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lines (51,52 and 53) are repeated so will run twice. The if statement will run them.

If the reason for doing so is to always validate the 3 elements, then do the opposite (check invalid) and use OR statements.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback.
I solve the problem by assign the validate functions results to three variables.Then check the variables to avoid run the functions twice
thank you again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants