Grow your CSS skills. Land your dream job.

how can i remove the bugs here [in disabling buttons]

  • # May 17, 2013 at 11:19 am

    for some reasons it did not run on codepen so created a [fiddle](http://jsfiddle.net/u3RZV/ “fiddle here”)

    their are many bugs here

    1. if the user fills both of the fields and then clears them the button is not disabled
    2. in my script i used two functions and they go like this

    • –>txt entered –> pass entered –> button enabled
    • –>pass entered –> txt entered –> button enabled

    and i believe it is a wrong way to do it

    so please help me out

    # May 17, 2013 at 11:24 am

    Yeah..I’m not sure what it is you are trying to achieve.

    Some sort of proper validation would make more sense than the confusing stuff I can see here.

    # May 17, 2013 at 11:29 am

    well there is validation that is working but with one problem
    i.e. it is either displaying wrong pass error or it is confirming the sign in but not displaying empty field error
    if u can help me out in that would be nice

    https://www.dropbox.com/sh/otgy1pypltgzpsq/vYRuH2Nge3?v=0mcn

    # May 17, 2013 at 11:37 am

    there is an error here.

    $(“.submit-name”).removeAttr(“disabled”);

    should be

    $(“.submit-name”).attr(“disabled”);

    # May 17, 2013 at 12:04 pm

    @unasAquila well the problem prevails still (the problem is when user fills the data and then deletes it)

    # May 17, 2013 at 12:15 pm

    >the problem is when user fills the data and then deletes it

    Why is this a problem?

    # May 17, 2013 at 12:22 pm

    i wanted that if the field(s) are empty then button is disabled if both are filled button is enabled
    but if user fills in the fields [button enabled] and then deletes the data in it then [**button is not disabled**] that is the problem!!!

    # May 17, 2013 at 12:24 pm

    Seems like an odd form of validation.

    Wouldn’t it make more sense to always have the button enabled but not **submit** the data if the minimum criteria isn’t met?

    Isn’t that the normal way.

    # May 17, 2013 at 12:30 pm

    well actually i was using it as a bypass for my errors in login.php which are now solved (thanks to @unasAquila)

    so this question now remains for educational purposes only

    if there is a way then post it else i am marking it as solved.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".