Home > Enterprise >  Why is it that when I enter `{{ something }}`, it also gets displayed in `HTML`?
Why is it that when I enter `{{ something }}`, it also gets displayed in `HTML`?

Time:05-22

I tried entering this code in my HTML:

<div>
    <input type="file" name="{{ form.forum_image }}" accept="image/*">
</div>

And this produces a site with the usual input file but after that is the text " accept="image/*"></div> What should I do with this so that it doesn't desplay the text? I included a picture.

CodePudding user response:

It looks like you have closed that input tag off early somehow. If you right click on your HTML page in your browser, and choose 'view page source' , you can see how the line is actually being sent. The behavior you show is consistent with the line being something like

<div>
    <input type="file" name="image.gif">" accept="image/*">
</div> 

If that's the case, you need to take a close look at your template and make sure you don't have a similar typo in there.

  • Related