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

Part 1&2 in Bike For Refugee Solution#1

Open
MohamadAlissa wants to merge 5 commits into
CodeYourFuture:masterfrom
MohamadAlissa:master
Open

Part 1&2 in Bike For Refugee Solution#1
MohamadAlissa wants to merge 5 commits into
CodeYourFuture:masterfrom
MohamadAlissa:master

Conversation

@MohamadAlissa

Copy link
Copy Markdown

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

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown

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.

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

Copy link
Copy Markdown

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
Copy Markdown
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