Product Landing Page Test: Submit Element

Product Landing Page Test: Submit Element
0.0 0

#1

Tell us what’s happening:

I’m sure I’m missing something incredibly simple, but I really can’t find out what it is.

User Story #12: When I click the #submit element, the email is submitted to a static page (use this mock URL: https://www.freecodecamp.com/email-submit) that confirms the email address was entered and that it posted successfully.

No matter how much I fiddle with the code, this particular user story doesn’t seem to want to be ticked off… link to codepen below.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/responsive-web-design-projects/build-a-product-landing-page


#3

That’s… not really helping me, but thanks.


#4

I haven’t worked on this project yet but one thought is to take a look at the sample project that FCC gives (or even look at other people’s projects) to see what they were doing different/same.


#5

Yup, already tried that. Even reached the point where I literally copied and pasted the code (terrible, I know) from the example project but the end result was exactly the same :confused:


#6

how about sharing your pen so we can see it?


#7

[redacted because I was looking at the wrong test suite so this was all irrelevant, as pointed out by ThatGuyWithAHammer]


#8

Thought I did, actually ! Isn’t it in the “Your code so far” section ? Here it is anyway https://codepen.io/ThatGuyWithAHammer/pen/LryJLO


#9

oh yeah sorry , I missed that!


#10

Hi Kevin,

I’m pretty sure that we’re reading different User Stories :slight_smile: ! If you check my #12, it says

User Story #12: When I click the #submit element, the email is submitted to a static page (use this mock URL: https://www.freecodecamp.com/email-submit 1) that confirms the email address was entered and that it posted successfully.

while yours

Inside the form element, I can select an option from a dropdown that has corresponding id=“dropdown”.’ TypeError: Cannot read property ‘tagName’ of null

It’s probably because by default a different test suite is loaded. Check the top left corner, green burger menu. It should let you change the suite to “Product Landing Page”, which is the challenge I’m currently doing :slight_smile:


#11

Yup, you’re right. It’s my first time dealing with the new tests. I’ll look at it now.


#12

It’s alright, this test suite got me pretty confused at the beginning, but after a while I must admit that it’s a huge improvement !


#13

OK, in the test error description, it says:

AssertionError: The #email input should have a name attribute : expected false to equal true

When I look at your html I see:

    <input type="email" id="email" placeholder="Enter your email here" target="_blank" required>

I don’t see a name attribute. When I add it, the test passes.


#14

Excuse me just a second, I’m going to hit myself on the head with a pan really hard. Once for forgetting that and twice for not reading through the error report… sigh, it was a really long day.

Thank you very much Kevin :slight_smile: !


#15

Sure. Don’t hit yourself too hard. We all do it from time to time. That’s why paired coding and code reviews are so popular.