Product Landing Page Test: Submit Element

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:

1 Like

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

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.

1 Like

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:

how about sharing your pen so we can see it?

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

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

oh yeah sorry , I missed that!

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:

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

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 !

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.

5 Likes

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: !

7 Likes

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.

4 Likes

It got me too! Had you not posted I would have never figured it out. I thought it was somewhere in the action or syntax on mine. I looked and tweak and fumbled around and wanted to scream when I added the name attribute and it went. I was so ticked off at myself for overthinking it.

3 Likes