Jump to content

Problem using pattern in footer template


ChrisTERiS

Recommended Posts

Hello all,

For some reason the pattern that I'm using in an input in footer.tpl breaks the page:

<input pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$" type="email" name="email" id="email" class="field form-control" placeholder="Email Address" required>
		

If i remove the pattern part it works fine.  The strange is that in a sidebar widget the exact same code works fine.

Any idea?

Thank you

Chris

Link to comment
Share on other sites

<input pattern="{literal}[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}${/literal}" type="email" name="email" id="email" class="field form-control" placeholder="Email Address" required>

Please try this.

Here is the excerpt from the Smarty documentation explaining what literal does:

Quote

{literal} tags allow a block of data to be taken literally. This is typically used around Javascript or stylesheet blocks where {curly braces} would interfere with the template delimiter syntax. Anything within {literal}{/literal} tags is not interpreted, but displayed as-is.

 

Edited by string
Dont wrap whole input into literal
Link to comment
Share on other sites

@string Thank you very much. I'm using literal tags for more than 10 years, there are already many calls is some js code in footer.tpl, but honestly never thought that it can be the reason of this issue. Even if at some point I gave a look there to see if there is any { or } symbol that may break the template. But really it was this. Now works fine.

Thank you again

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated