Hi again,
I try to apply the advice for less load.
So the checking is initiated when form is submited rather that at each input.
html part
Code:
<form name="form1" id="form1" action="writeRequestIni.php" method="post" onsubmit="deepCheckForm(); return false;">
[...]
<tr><td align="left"></td><td><input type="submit" name="submit" id="submitID" value="Submit" disabled="disabled" /></td>
</form>
<br /><div name="displayResult" id="displayResultID" style="background-color:white;color:black"></div>
java script part
Code:
function deepCheckForm() {
var el = document.getElementById('sourceID');
ajaxCheckDirIfExists('checkDirectoryExists.php',el.value, el.id);
// WAIT <-- ???
alert('color : '+el.style.backgroundColor+'\nname : '+el.value); //DEBUG
//
xmlhttpPost('writeRequestIni.php', 'form1', 'displayResultID', '<img src=\'img/circleloading.gif\'>');
}
My problem here, is that when I perform the validity check about the existing directory
Code:
ajaxCheckDirIfExists('checkDirectoryExists.php',el.value, el.id);
The code continue and display the next alert before receiving the check result :/
I tried different tricks to temporize as using a
Code:
while (el.value == '') {
// do nothing
}
but either it hangs or do not work ...
Is there a way to fix this ?
Bookmarks