Tell us what’s happening:
Your code so far
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form>
<input type="text" placeholder="cat photo URL">
<form action="/https://freecatphotoapp.com/submit-cat-photo">
</form>
</main>
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
.
Challenge: Create a Form Element
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
Hey @annie2971 !
Welcome to the forum!
Your form only needs an opening <form>
and an end tag</form>
.
The form should look like this
<form>
<input>
</form>
The url in the action is incorrect. Please copy it exactly from the lesson.
Hope that helps!
Hi
Thanks for your reply.
Can you be more specific to what is not right about my code?
As mentioned, the url is incorrect. It has an extra character in it.
Also you have two opening form tags <form>
and one end form tag </form>
So my example above has one opening tag and one closing tag.
You need to structure like I did above.
Make sense?
Sorry, but I have triple checked and don’t see an extra character. If you are referring to the / before the url, I am following the example given.
And how about the ? You have not listed as an element…
Today is my very first time ever going over this
Please bare with me!
I meant to say How about the * form action
This is the url I just copied from the lesson
https://freecatphotoapp.com/submit-cat-photo
Yours has a forward slash in it.
I copied it from here
Nest the existing input element inside a form
element and assign "https://freecatphotoapp.com/submit-cat-photo"
to the action
attribute of the form
element.
Let’s try this approach.
Using the correct url you will place this first
<form action="/https://freecatphotoapp.com/submit-cat-photo">
then this
<input type="text" placeholder="cat photo URL">
then this
</form>
I followed the example they gave:
For example:
<form action="/url-where-you-want-to-submit-form-data"></form>
But have tried without it and still showing as wrong…
So that was just an example not the actual one you are supposed to use
annie2971:
It didn’t work…shouldn’t I start with ?
Look back to a few posts ago where I laid it out for you. Just replace the url in the action.
it was in this last part of the instructions
inside a form
element and assign "https://freecatphotoapp.com/submit-cat-photo"
to the action
attribute
It worked! So, I DON’T have to start with < form > always?
This is how it ended up:
When it said that it had to be nested into a form element, I assumed I had to start with < form > and end with < / form >
Hmmm I am a little confused. Can I see your code?
Note that the section starts with form action NOT < form >
1 Like
Yeah that’s correct. What you had in your original code were two of these <form>
and one of these </form>
If you look at your first answer versus the correct one you will see what I mean.
Hope that makes sense now.
annie2971:
form action
This is still considered an opening tag it just happening to have the action attribute in it. So that’s what I mean by two opening tags.