Hi,

i have a password-change-formular with Ajax-Request. After the click on 
submit i call the function "doRequest_password();". After the evaluation 
of the form elements i call the function "fwait('Please wait!');" to 
display an "Please wait!"-modal-window. Then i do the ajax-request and 
call the php-file which insert the new password into the database (if 
all informations are correct). That works fine. But when the old 
password is incorrect the php-file returns an info 
"http_request.responseText" which i want to display in an 
alert-modal-window. To avoid multiple modal windows  i call the function 
"fwait('');" to close the existing "Please wait!"-modal-window and then 
i call the function "falert(http_request.responseText);". In this moment 
an browser-alert-window appears with the message "Window modal_dialog is 
already register is the DOM!!, be sure to setDestroyOnClose()". After 
that the alert-modal-window appears.  I don't know how to prevent the 
browser-alert-window message. The only way i found is to set a timeout 
between 2 modal windows. Can i use "Window.keepMultiModalWindow" to 
solve the problem. If yes, how? If not, how else can i prevent the 
browser-alert-window?

Thx

function fwait(txt){
    if(txt==''){
        Dialog.closeInfo();
    }else{
        Dialog.info("<div align=center class=size3>" + txt + "</div>", 
{windowParameters: {className: "nst_cms", width:300, height:150}, 
showProgress: true, showEffectOptions: {duration:1}});
    }
}

function falert(txt){
    if(txt!="")
        Dialog.alert("<p align=center 
class=size2>&nbsp;<br>"+txt+"<br>&nbsp;</p>", {windowParameters: 
{className: "nst_cms", title: "Error", width:400, height:200, 
showEffectOptions: {duration:1}}, buttonClass: "bt", okLabel: "close", 
ok:function(win) {debug("validate alert panel"); return true;}});
}

function doRequest_password(){
    ...
      evaluation
    ...

   // Waiting
   fwait('Please wait!');

    // PHP-File
   var v_php = 'inc/password.ajax.php?id=' +v_ id + '&pw=' + v_pw.value 
+ '&pw_new=' + v_pw_new.value + '&pw_new2=' + v_pw_new2.value;

    // request-handler
   http_request.onreadystatechange = myHandler_password;
   http_request.open('GET', v_php, true);
   http_request.send(null);
}

function myHandler_password() {
   if (http_request.readyState == 4) {
      fwait('');
      if(http_request.status != 200)
      {
         falert(http_request.status);
      }             else if(http_request.responseText!="")
      {
         falert(http_request.responseText);
      }
      else
      {                document.forms['form_pw'].elements['pw'].value = "";
         var v_pw_new = document.forms['form_pw'].elements['pw_new'].value;
         finfo('Password changed','Your new password: 
<b>"+v_pw_new+"</b>.');
         document.forms['form_pw'].elements['pw_new'].value = "";
         document.forms['form_pw'].elements['pw_new2'].value = "";
      }
   }
}

_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com

Reply via email to