Title: Cannot add javascript
Last modified: August 22, 2016

---

# Cannot add javascript

 *  Resolved [kvantumpeter](https://wordpress.org/support/users/kvantumpeter/)
 * (@kvantumpeter)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/cannot-add-javascript/)
 * 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://wordpress.org/plugins/popups/](https://wordpress.org/plugins/popups/)

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

 *  Plugin Author [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735175)
 * Does the code appears? You get any error?
 *  Thread Starter [kvantumpeter](https://wordpress.org/support/users/kvantumpeter/)
 * (@kvantumpeter)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735186)
 * 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/](http://masvagyokdeelvezem.hu/)(
   the popup appears at 90%)
 * There was an update now, didnt help either.
 * Thanks in advance!
 *  Plugin Author [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735198)
 * 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](https://github.com/timersys/popups/archive/master.zip)
 *  Thread Starter [kvantumpeter](https://wordpress.org/support/users/kvantumpeter/)
 * (@kvantumpeter)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735202)
 * I disabled the old one and installed this dev version. Nothing changed so far(
   or should i remove the old one?)
 *  Plugin Author [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735203)
 * 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](https://wordpress.org/support/users/kvantumpeter/)
 * (@kvantumpeter)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735212)
 * 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](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735214)
 * 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](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735257)
 * Closing due to inactivity

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

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

 * ![](https://s.w.org/plugins/geopattern-icon/popups_efeef0.svg)
 * [Popups - WordPress Popup](https://wordpress.org/plugins/popups/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/popups/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/popups/)
 * [Active Topics](https://wordpress.org/support/plugin/popups/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/popups/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/popups/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [popup](https://wordpress.org/support/topic-tag/popup/)

 * 8 replies
 * 2 participants
 * Last reply from: [Damian](https://wordpress.org/support/users/timersys/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/cannot-add-javascript/#post-5735257)
 * Status: resolved