私の機能は完全に機能しています。しかし、onclick機能を使用すると、ボタンを非表示にしたり、新しいボタンを表示したりできないようです。
サンプル:
var download = document.getElementById('download');
function RemoveDoc(Doc)
{
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","functions/remove.php?Doc="+Doc,true);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
download.syle.visibility='hidden';
download.style.display ='none'
document.getElementById("RemoveMsg").innerHTML= xmlhttp.responseText;
}
}
xmlhttp.send();
return false;
}
私のフォーム
//I tried to add in the download button to be hidden here but still invalid
<input type="submit" id="remove" name="Name" value="Remove" onclick="return RemoveDoc(this.value); document.getElementById('download').style.visibility='hidden'; return false;" />
<input type="submit" id="download" value="download"/> //want to hide this button.
<input type="file" id="reupload"/> //want to show this.
関数が正常に呼び出された後にダウンロードが消えるには、display='none'も無効にしようとしました。親切なアドバイス