Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 <div> refresh after form submission - a bug

View previous topic View next topic Go down 
AuthorMessage
DreamsFade
Member
Member
DreamsFade

Posts : 12
Join date : 2011-04-17

<div> refresh after form submission - a bug Empty
PostSubject: <div> refresh after form submission - a bug   <div> refresh after form submission - a bug EmptyTue Jun 21, 2011 7:16 pm

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;
  }); 
 });
Back to top Go down
TAXXX
Member
Member
avatar

Posts : 19
Join date : 2011-03-09

<div> refresh after form submission - a bug Empty
PostSubject: Re: <div> refresh after form submission - a bug   <div> refresh after form submission - a bug EmptyTue Jun 21, 2011 7:17 pm

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;
Back to top Go down
Twerk
Member
Member
Twerk

Posts : 26
Join date : 2011-04-17

<div> refresh after form submission - a bug Empty
PostSubject: Re: <div> refresh after form submission - a bug   <div> refresh after form submission - a bug EmptyTue Jun 21, 2011 7:17 pm

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);" />
Back to top Go down
Sponsored content




<div> refresh after form submission - a bug Empty
PostSubject: Re: <div> refresh after form submission - a bug   <div> refresh after form submission - a bug Empty

Back to top Go down
 

<div> refresh after form submission - a bug

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» asp.net form
» Validate form
» AutoFilling an edit form using C#.NET and SQL
» form validation of a checkbox not quite right
» Ajax/jQuery Form $_POST and use PHP?

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: <div> refresh after form submission - a bug Edit-trash Useless :: Trash-