DreamsFade Member
Posts : 12 Join date : 2011-04-17
| Subject: <div> refresh after form submission - a bug Tue 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; }); });
|
|
TAXXX Member
Posts : 19 Join date : 2011-03-09
| Subject: Re: <div> refresh after form submission - a bug Tue 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;
|
|
Twerk Member
Posts : 26 Join date : 2011-04-17
| Subject: Re: <div> refresh after form submission - a bug Tue 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);" /> |
|
Sponsored content
| Subject: Re: <div> refresh after form submission - a bug | |
| |
|