• Resolved kvantumpeter

    (@kvantumpeter)


    I have a hungarian newsletter subscription form which i wanna use this plugin with. But the javascript button doesnt work in the popup. I tried uncompressed js option, still doesnt work.

    What should i do?

    In case needed, here is the code:

    JavaScript ellenőrző kód eleje –>
    <script type=”text/javascript”>
    function fvalidate_1(fname)
    {
    var formx=document.getElementById(fname);
    var hiba=”;
    var mregexp=/^([a-zA-Z0-9_\.\-\+&])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/;
    if(!mregexp.test(formx.subscr.value))
    {
    hiba=’* Hibás a megadott e-mail cím!’;
    formx.subscr.focus();
    }

    if (!formx.f_3.value)
    {
    hiba+= (hiba?”\n”:”)+’* Keresztnév nincs megadva!’;
    formx.f_3.focus();
    }
    if(hiba)alert(hiba); else return true;
    }
    </script>
    <!– JavaScript ellenőrző kód vége –>

    https://ww.wp.xz.cn/plugins/popups/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Damian

    (@timersys)

    Does the code appears? You get any error?

    Thread Starter kvantumpeter

    (@kvantumpeter)

    No, the code does not appear. I ve put a snippet plugin to be able to use javascript in the wordpress editor, as it cuts all codes.

    With this snippet i succesfully used the same subscription form everywhere, but it aint work on this popup 🙁

    Here is a test site with the popup:
    http://masvagyokdeelvezem.hu/
    (the popup appears at 90%)

    There was an update now, didnt help either.

    Thanks in advance!

    Plugin Author Damian

    (@timersys)

    I see two errors, one from my plugin and another from that javascript. Try installing dev version from https://github.com/timersys/popups/archive/master.zip

    Thread Starter kvantumpeter

    (@kvantumpeter)

    I disabled the old one and installed this dev version. Nothing changed so far (or should i remove the old one?)

    Plugin Author Damian

    (@timersys)

    keep the dev version. You still have a javascript error when the form is going to be submitted that says

    Uncaught SyntaxError: Invalid regular expression: /^([a-zA-Z0-9_.-+&])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,6})+$/: Range out of order in character class

    You need to resolve that in order to the form submit

    Thread Starter kvantumpeter

    (@kvantumpeter)

    Sorry, i dont know anything about javascript 🙁
    Shouldnt it be working in the popup as it works now on several pages?

    I wanna solve this problem, because i really like your plugin. Simple, easy to use and i love how i can set up which pages / posts is on. Cant wait to work with the exit intent option.

    Plugin Author Damian

    (@timersys)

    Why is not working im not sure im not a regex expert.

    Try changing this:
    var mregexp=/^([a-zA-Z0-9_\.\-\+&])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/;

    into this:
    var mregexp=/^([a-zA-Z0-9_\\.\\-\\+&])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,6})+$/;

    Plugin Author Damian

    (@timersys)

    Closing due to inactivity

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Cannot add javascript’ is closed to new replies.