Using javascript less than sign
Hi, I'm not sure if this is the right page to post this or not, but I am trying to put some javascript code into contao, but as soon as it gets to a part that has this <1... It strips the rest of the code... It seems to have an issue with the < sign... Is there a way to get contao to allow this? I tried adding <<> into settings in html tags, but it didn't work... Any ideas??
Re: Using javascript less than sign
Re: Using javascript less than sign
Doesn't work, because it is within javascript and the javascript needs the < sign in order to work...
Here this is what I'm trying to do...
Code:
function validateForm()
var x=document.forms["faminfo"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
{
alert("Not a valid e-mail address");
return false;
}
It's the if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) that contao strips...
Re: Using javascript less than sign
Where are you adding it from (custom module? html content element? page layout?)
If you haven't already try Themes::Page Layout::Custom JavaScript code
Re: Using javascript less than sign
Thanks, the custom javascript code worked in the page layout.
I was trying to do it in a custom html article... But I didn't think of the page layout. Thanks again! :D