Results 1 to 3 of 3

Thread: Writing a cookie

  1. #1
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Writing a cookie

    Hello

    I'd like to write a cookie when a user check a box but it doesn't work...
    Can anyone help me?

    I have a module which contains:
    Code:
    <div>
    <label onchange="noShow(); return false;">Don't show anymore <input name="ver" type="checkbox" value="1" /></label>
    </div>
    and a little script:
    Code:
    <script type="text/javascript">
    function noShow(){
    Cookie.write('noshow', '1', {duration: 1});
    }
    </script>
    Thank you for your help
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default Re: Writing a cookie

    I think there is no onchange event on LABEL, try it on the INPUT.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Re: Writing a cookie

    yep !

    it works.
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

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
  •