Before you ask please READ THIS

Problem with comment-form

edited June 2013 in Airlock Posts: 17
Hey there,

I want to use antispam bee with this theme and for that, I am wondering where inside that theme is the javascript which checks whether the textarea "comment" in comment form is filled or not?

Antispam Bee adds another textare to the comment area and hide the "comment" one for checking whether a spambot is commenting. Since a human cannot fill the "comment"-textarea, there is always an error "no comment" while sending.

Any ideas? Greping all day long :)
Post edited by lotuz on

Comments

  • AirAir
    Posts: 10,970
    Hello there

    On start I have to apologize for quality of JS you will find there, as it is very bad and old.

    You fill find code for it in wp-content\themes\airlock\common\js\scripts.js line ~304 starting with this:

    /** Comment validation ***/
    if ($('#commentform').length) {
    With regards.
  • Posts: 17
    Hello air,

    thanks for your quick reply! I found that js already but wasnt able to handle it yet. Even when just comment it out, the error handling in the commentform stay the same, but maybe I made some mistakes.

    If there is time, maybe you have an idea how to deal with several text-areas? I just want the error handling deal with one specific textarea.

    I will check for myself too. since antispam bee is quiet a cool plugin in, it might be useful for other people as well.

    Thanks in advanced! And by the way, that theme, even with some old parts of code, rocks ;)
  • Posts: 17
    Hey Air,

    checked it again. When I comment this validation out, some magic still handling some errors and I have no idea why :(
  • Posts: 17

     

     

     

    Hey Air, sorry for bothering. Of course it was this script part, I just was into to much c++ last days, forget to comment it out with /** **/ For all who want to use antispam bee and do not give up the ajax-form, just add

    $(this).find('input.required, textarea[name="96023-comment"]').each(function(){

    where

    $(this).find('input.required, textarea').each(function(){

    was before, while 96023 is the number antispam-bee adds to the form (some hash from your first url-letters, it is static).

     

     

     

     

  • Posts: 17
    Hey Air,

    just another topic came up. For one or the other reason, validating the email does not work properly. If something is entered in email-field, just wordpress default validation is thrown, not the java-regex.

    Just check here: http://themeforest.net/item/airlock-portfolio-wordpress-theme/full_screen_preview/904440 with typing something, not an email, inside the field.

    Guess it is because the call "hasClass" (ln 340 n advanced/js/script.js) isn't true, since the input has no class "email". Right?

    Any ideas for clean solution
  • Posts: 17

     

     

     

     Sorry, it is me again :) For those who want to have the feature of ajaxified precheck of email input, just do the following:

    if( $(this).hasClass('email') ){ //LN 338 of common/js/script.js

    in

    if( $(this).is('#email') ){

    Maybe it should be considered to add it to the next update or rebuild. However, thanks for your outstanding work!

     

     

     

  • AirAir
    Posts: 10,970
    Hi there lotuz which write lot of posts ;-)

    I have read what you wrote and I am confused what you need now:-)
    Can you point it in short point(s)?

    With regards.
  • Posts: 17
    No need from my side anymore.

    Last two posts describe an error with email-check in comment and feedback form and the corresponding fix (up to now, email-validation is not working with java, just native with wordpress ... test it yourself with your demo blog and a wrong email address).

    First posts were about having multiple textareas (within comment form) and for spam detecting purposes, and check just one specific with java script. Also solved for those who are also interested.

    I am fine, thanks for help :)
  • AirAir
    Posts: 10,970
    Validation of mail works for me. Maybe it is some other issue with plugin that you are using. You can also post here string what pass validation and it shouldn't do that ;-)

    Thanks and with regards.
  • Posts: 17
    It must be some magic in your browser, but for sure, it is not working in the demo blog ;)

    Just write a comment with an unvalid email address http://themes.apollo13.eu/airlock/2011/11/20/honda-microcommuter-concept/#comments

    My string was: "fdgdfsgfdsghf" ;) and it passes the validation (not marked red, instead, the wordpress inbuild-validation was triggered) ....
  • AirAir
    Posts: 10,970
    Sorry you are right. Indeed it only checks if email is not empty. If you really need it I can try to write for you what should be changed to make it validate e-mail or I will update patch for Airlock that you were asking earlier:-)

    With regards.
  • Posts: 17
    Hey Air,

    no worry about that, just want to help. I give suggestions for a patch here: http://support.apollo13.eu/discussion/comment/5444#Comment_5444

    Guess that should be all the staff a patch should need.

    With regards
  • AirAir
    Posts: 10,970
    Ooo thanks for that. I have missed it:-S
    I will update patch with it later.

    With regards.
  • AirAir
    Posts: 10,970
    Added to patch :-)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion