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 3 of 3
  1. #1
    Regular Coder grumpy's Avatar
    Join Date
    Oct 2006
    Location
    Visible light spectrum
    Posts
    121
    Thanks
    5
    Thanked 6 Times in 6 Posts

    Question <div> refresh after form submission - a bug

    Hi,

    The code below in red should be to refresh a certain div on the page after a form has been submitted - this form lives on another page. The form submission and the success data #results is being outputed correctly, but the div is not refreshing. This div refreshes correctly with a similar code within another function, but not within this one. Any suggestions?

    Code:
    // ask for validation on monitor delete, pause, resume request
    $(document).ready(function(){
    		$("#mondelpau").validate({
    			debug: false,
    			rules: {
    				act: "required",
    				uid: "required",
    				sid: "required",
    			},
    			/*messages: {
    				name: "Please let us know who you are.",
    				email: "A valid email will help us get in touch with you.",
    			},*/
    			submitHandler: function(form) {
    				// do other stuff for a valid form
    				$.post('delpaures.php', $("#mondelpau").serialize(), function(data) {
    					// refresh the monitor list div
    					var dataString8 = 'ajax=1&uid=' + uid;
    				     $.ajax({
    				    	 type: "GET",
    				    	 url: "monpanel.php",
    				    	 data: dataString8,
    				    	 success: function(html_data){
    				    	 	$('#list_monitors').html(html_data);
    				     	}
    				     });
    					
    					$('#results').html(data);
    					//alert (data);return false;
    					
    				});
    			}
    		});
    	});
    This is the function in which the same code works perfectly in refreshing the div:

    Code:
    $(function() {  
       $('.error').hide();  
       $(".button").click(function() {  
         // validate and process form here  
       
         $('.error').hide();  
           var domain = $("input#domain").val();  
            if (domain == "") {  
           $("label#domain_error").show();  
           $("input#domain").focus();  
           return false;  
         }  
            var com_domain = $("input#com_domain").val();  
             if (com_domain == "") {  
           $("label#com_domain_error").show();  
           $("input#com_domain").focus();  
           return false;  
         }  
    		var cemail = $("input#cemail").val();
    		var port = $("select#port").val();
    		var active = $("input#active").val();
    		var uid = $("input#uid").val();
    		var main = $("select#main").val();
    		
    	 var dataString = 'cemail='+ cemail + '&domain=' + domain + '&com_domain=' + com_domain + '&active=' + active + '&main=' + main + '&port=' + port;  
    	 //alert (dataString);return false;  
    	 $.ajax({  
    	   type: "POST",  
    	   url: "user_add.php",  
    	   data: dataString,  
    	   success: function() {  
    	     $('#monitor_form').append("<div id='message'></div>"); 
    	     $('#monitor_form form')[0].reset();
    	     $('#message').html("<img id='checkmark' src='images/tick.png' /><b> Monitor sucessfully added!</b>")  
    	     .hide()  
    	     .fadeIn(500, function() {  
    	       $('#message').append("");  
    	     });
    	     setTimeout("$('#message').hide().remove();", 6000);
    	     
    		 var dataString2 = 'ajax=1&uid=' + uid;
    	     $.ajax({
    	    	 type: "GET",
    	    	 url: "monpanel.php",
    	    	 data: dataString2,
    	    	 success: function(html_data){
    	    	 	$('#list_monitors').html(html_data);
    	     	}
    	     });
    		 //document.onkeydown = showDown;
    	   }  
    	 });  
    	 return false; 
       });  
     });
    No-bull Bite-sized business strategy and marketing - FreeOfNoise.com

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,396
    Thanks
    12
    Thanked 569 Times in 562 Posts
    In this line you are using "uid" ... where is it defined? I don't see it in the first code piece
    Code:
    var dataString8 = 'ajax=1&uid=' + uid;

  • #3
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post flex videoDisplay.totaltime is NaN -1

    I am working on a project in which i am using videoDisplay component to load flv and its totaltime is NaN or -1. Can any one help on this?

    private function videoDisplay_playheadUpdate(evt:VideoEvent):void {
    progressBar.setProgress(evt.playheadTime, videoDisplay.totalTime);
    trace(evt.playheadTime+" : "+videoDisplay.totalTime)
    }


    <mx:VideoDisplay id="videoDisplay" source="{VIDEO_URL}" width="100" height="100"
    ready="videoDisplay.visible = true;"
    metadataReceived="videoDisplay_metadataReceived(event);"
    playheadUpdateInterval="50"
    stateChange="videoDisplay_stateChange(event);"
    playheadUpdate="videoDisplay_playheadUpdate(event);" />


  •  

    Posting Permissions

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