Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2012, 10:46 PM   PM User | #1
Chris-2k
Regular Coder

 
Join Date: May 2011
Posts: 303
Thanks: 29
Thanked 0 Times in 0 Posts
Chris-2k is an unknown quantity at this point
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???
Chris-2k is offline   Reply With Quote
Old 10-06-2012, 12:03 AM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
put return true after the hide and show, not before
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Users who have thanked DanInMa for this post:
Chris-2k (10-06-2012)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:47 PM.


Advertisement
Log in to turn off these ads.