in reply to Re^4: Onkeyup not working
in thread Onkeyup not working

Yes. Once you use single quotes, you don't need to put backslashes into your Javascript anymore. You can remove one backslash from each escape, turning \\w back into \w, and removing most of the others.

Again, consider moving your HTML into external files.

Replies are listed 'Best First'.
Re^6: Onkeyup not working
by frank1 (Monk) on Oct 07, 2023 at 18:49 UTC

    Thank you very much. it has worked

Re^6: Onkeyup not working
by frank1 (Monk) on Oct 08, 2023 at 11:20 UTC

    one thing i have notice that i cant print out string values to html

    like

    $name = "jone";

    then when i call $name in html

    $name to print jone. it will just show $name in html

      Perhaps reading Quote and Quote-like Operators while paying particular attention to interpolation will help you understand this.

      use strict; use warnings; use feature q/say/; my $name = q/jone/; say q/name is $name (non-interpolating)/; say qq/name is $name (interpolating)/;

      🦛

        still its not workin out. this is the script

        it only prints $name not jone

        #!/usr/bin/perl -wT use strict; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); my $name = "jone"; print "Content-type: text/html\n\n"; print <<'HTML'; <!DOCTYPE html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquer +y.min.js"></script> </head> <body> <input type="text" class="keyup-email text-input" name="7" value=""> <button type="butt +on" id="m1p" class="edBtn"> submit </b> </button> $name <script> $('.keyup-email').keyup(function() { var inputVal = $(this).val(); var emailReg = /^(?!.*_)\w+([\.-]?\w+)*@\w+([\.-]? +\w+)*(\.\w{2,3})/; if(!emailReg.test(inputVal)) { $(".edBtn").prop("disabled", true); } else if(inputVal == 'test@test.com') { $(".edBtn").prop("disabled", true); }else{ $(".edBtn").prop("disabled", false); } }); </script> </body> </html> HTML
Re^6: Onkeyup not working
by misc (Friar) on Oct 11, 2023 at 10:05 UTC
    Would also be possible to escape the html code by hand. :p just 2 cents grin
    oh. it's mostly already escaped. I better escape myself