Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts

    jQuery Problem with val()

    I created some function

    PHP Code:
    function someFunction() {
    if ( $(
    "input[type=text][name|='url']").val() != "" &&
                $(
    "input[type=text][name|='t']").val() != "" &&
                $(
    "input[type=text][name|='a']").val() != "" ) {
    // someCodes if true


    } else {
    // someCodes if !true
    }

    and the problem is the if ( $("input[type=text][name|='url']").val() != "" && $("input[type=text][name|='t']").val() != "" && $("input[type=text][name|='a']").val() != "" ) { still be true even if <input type="text" name="url" />, name="t" and name="a" values are blank.

  • #2
    New Coder
    Join Date
    May 2009
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ohw ok, nvm.. that was dumb. :/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •