Results 1 to 5 of 5

Thread: Using javascript less than sign

  1. #1
    New user
    Join Date
    02-18-12.
    Posts
    16

    Default 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??

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Using javascript less than sign


  3. #3
    New user
    Join Date
    02-18-12.
    Posts
    16

    Default 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...

  4. #4
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default 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

  5. #5
    New user
    Join Date
    02-18-12.
    Posts
    16

    Default 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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •