SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Activate Button

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Activate Button

    I have a jquery function that will upload an image to the server and then back to the html page. The image transfer works fine but I am trying to enable a button on transfer completion but I not meeting with success. I am sure I am missing something but do not see it. If anyone can offer a suggestion I would appreciate it. The function is

    Code javascript:
    $(document).ready(function()
    {
    	$('#image_upload_form').submit(function()
    	{
    		$('#product_type_image').attr('src', '../images/misc/loading.gif');
    	});
     
    	$('iframe[name=upload_to]').load(function()
    	{
    		var result = $(this).contents().text();
    		$('#button_three').attr('disabled', false); 
     
    		if (result != '')
    		{
    			if (result == 'Err:big')
    			{
    				$('#product_type_image').attr('src', '../images/misc/imagebig.png');
    				return;
    			}
     
    			if (result == 'Err:format')
    			{
    				$('#product_type_image').attr('src', '../images/misc/imageformat.png');
    				return;
    			}
     
    			$('#product_type_image').attr('src', $(this).contents().text());
     
                            $('#button_three').attr('disabled', false); <==== this is the code not working correctly, or at least as I think it should
    		}
    	});
    });

    Thanks
    Last edited by paul_wilkins; Apr 13, 2013 at 13:48. Reason: add code tags


Bookmarks

Posting Permissions

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