WTF Singularity (AJAX edition)



  • Seriously, count the things wrong with this code plucked from a public student management suite:

    if(!notEmpty(child_dob,'Please enter Date of Birth'))
    {		
    	return false;		
    }
    if(!notEmpty(nickname, 'Please enter only letters for your Nick Name'))
    {		
    	return false;		
    }
    if(!notEmpty(age,'Please enter Number in Age'))
    {
    	return false;
    }
    

    I need to go bleach my soul. Or maybe I'll scrub it clean with some AJAX.



  • So what, because you plucked the code from somewhere you want to force people to also pluck the code from your post? TRWTF is not using the friggin preview tab.



  • @Speakerphone Dude said:

    So what, because you plucked the code from somewhere you want to force people to also pluck the code from your post? TRWTF is not using the friggin preview tab.

    @Kerin said:

    <font color="#0000FF" face="comic sans ms,sand" size="5">if(!notEmpty(child_dob,'Please enter Date of Birth')) { return false; }</font>

    <font color="#0000FF" face="comic sans ms,sand" size="5"> if(!notEmpty(nickname, 'Please enter only letters for your Nick Name')) { return false; }</font>

    <font color="#0000FF" face="comic sans ms,sand" size="5"> if(!notEmpty(age,'Please enter Number in Age')) { return false; }</font>

    <font face="comic sans ms,sand"> </font>




  • @El_Heffe said:

    @Speakerphone Dude said:

    So what, because you plucked the code from somewhere you want to force people to also pluck the code from your post? TRWTF is not using the friggin preview tab.

    @Kerin said:


    <font color="#0000FF" face="comic sans ms,sand" size="5">if(!notEmpty(child_dob,'Please enter Date of Birth'))
    {
    return false;
    }</font>

    <font color="#0000FF" face="comic sans ms,sand" size="5">
    if(!notEmpty(nickname, 'Please enter only letters for your Nick Name'))
    {
    return false;
    }</font>

    <font color="#0000FF" face="comic sans ms,sand" size="5">
    if(!notEmpty(age,'Please enter Number in Age'))
    {
    return false;
    }</font>

    <font face="comic sans ms,sand">
    </font>




    On or around August 13th of 2012, when you posted your first reply to the "WTF Singularity (AJAX edition)" thread, did you or did you not use the preview tab?



  • Nope, I didn't.



  • @Kerin said:

    Nope, I didn't.
    Don't feel bad. Whenever I accidentally cli

    çk øń įt, ït męšśëš ūp mÿ fõrmåttîñg.



  • @El_Heffe said:

    @Kerin said:

    - - - - - - - - - -    8>< comic sans ms - - - - - - -

    <font color="#0000FF" face="comic sans ms,sand" size="5"></font>

     

    First against the wall, come the revolution, comrades.

     



  • Other than the double negative, what did you have in mind? (I've taken pretty much this approach with a couple of forms, albeit they're only used once every few months in practice, and all they do is e-mail the entered data to someone for manual review)

     



  • @emurphy said:

    Other than the double negative, what did you have in mind?
     

    Yeah, that was my reaction too.  Aside from "!notEmpty", this looks like perfectly sensible form validation code.




  • @Kerin said:

    Seriously, count the things wrong with this code plucked from a public student management suite: if(!notEmpty(child_dob,'Please enter Date of Birth')) { return false; } if(!notEmpty(nickname, 'Please enter only letters for your Nick Name')) { return false; } if(!notEmpty(age,'Please enter Number in Age')) { return false; } I need to go bleach my soul. Or maybe I'll scrub it clean with some AJAX.
    Sorry, I'm missing the reason what this has to do with AJAX.  Because it's JavaScript?



  • @Cassidy said:

    Filed under: Comic Sans brings the rageface.
    Comic Sans brings Unicorns and Rainbows.


     



  • @El_Heffe said:

    @Cassidy said:

    Filed under: Comic Sans brings the rageface.
    Comic Sans brings Unicorns and Rainbows.


     

    LFTY



  • @C-Octothorpe said:

    @Kerin said:

    Seriously, count the things wrong with this code plucked from a public student management suite: if(!notEmpty(child_dob,'Please enter Date of Birth')) { return false; } if(!notEmpty(nickname, 'Please enter only letters for your Nick Name')) { return false; } if(!notEmpty(age,'Please enter Number in Age')) { return false; } I need to go bleach my soul. Or maybe I'll scrub it clean with some AJAX.
    Sorry, I'm missing the reason what this has to do with AJAX.  Because it's JavaScript?

    From the "bleach my soul" comment I understand that here is the AJAX he talks about:



  • @Mason Wheeler said:

    Yeah, that was my reaction too.  Aside from "!notEmpty", this looks like perfectly sensible form validation code.

    What? A check for an empty nickname also magically detects non-alphabetic characters supplied?

    Perhaps it's sensible form validation code, but it's non-sensical feedback.


Log in to reply