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
    Regular Coder
    Join Date
    May 2011
    Posts
    303
    Thanks
    29
    Thanked 0 Times in 0 Posts

    jquery form submit: display div

    hi

    can any1 help me..

    this code isn't working, well it is, right up until it actually submits the form.....

    Code:
            if(document.URL.indexOf("/") || document.URL.indexOf("index.php") || document.URL.indexOf("index.php#local")) {
                if (!fileInput || fileInput == '') {
                    // dont submit the form
                    $('#warning').append("You must select an image or enter a url first	<a href='#close' id='close'>close</a>").fadeIn(2000);
                    $('#warning').slideDown();
                    return false;
                } else {
                    // submit
                    return true;
                    // show progress bar
    				$(".upload_btn").hide();
    				$("#progress").show();
                }
            }
            if(document.URL.indexOf("index.php#remote")) {
                if (!remoteInput || remoteInput == '') {
                    // dont submit the form
                    $('#warning').append("You must select an image or enter a url first	<a href='#close' id='close'>close</a>").fadeIn(2000);
                    $('#warning').slideDown();
                    return false;
                } else {
                    // submit
                    return true;
                    // show progress bar
    				$(".upload_btn").hide();
    				$("#progress").show();
                }
    		}
    it's just not hiding the btn and showing the progress......

    anby help???

  2. #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    put return true after the hide and show, not before

  3. Users who have thanked DanInMa for this post:

    Chris-2k (10-06-2012)


 

Posting Permissions

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