Conflicts using <form input>

I am totally unable to use the solutions of others with this program (they do not work when I use them). Also unable to find a variation of that is acceptable to the AI! Been working on this for days now.


<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="https://www.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 action="/submit-cat-photo"> <input type="text" placeholder="cat photo URL" /> </form>
</main>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0

Challenge: Create a Form Element

Link to the challenge:

Well now this works: can someone explain why it now works and was rejected so many times before? Tiny typo before?

<form action="https://www.freecatphotoapp.com/submit-cat-photo">
    <input type="text" placeholder="cat photo URL">
  </form>

In your first posted code, you used the following.

Now use the code below.

Can you see the difference? A little hint: have a look at the action attribute of the form element.

A large problem for me was that several persons claimed to have used code that omitted the first half of the https://www.freecatphotoapp.com/ and that the AI allowed the use of action="/submit-cat-photo". It certainly did not for me.

The challenge specifically mentions to assign "https://www.freecatphotoapp.com/submit-cat-photo" to the action attribute of the form element.

You won’t pass all the test cases if you don’t set the value of your action attribute to the exact url mentioned on the challenge.

Also, it makes sense because the idea here is to create a web form that actually submit data to a server and you are unlikely to find any server url with this format only:
/submit-cat-photo

I am nearly certain that /submit-cat-photo would work if the server you are using is www.freecatphotoapp.com. The convention of putting a slash or backslash at the beginning of a file path is extremely common; it is used for most operating systems such as Linux and Windows. A slash or backslash at the beginning of a file path indicates the top of the file system’s hierarchy.

Many thanks, SamHobbs, for this explanation. I have taken one course in Linux, and now recall that use of the forward slash for that purpose. It explains the varies reports of /submit-cat-photo working in some examples.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.