XHR(ajax)を介してクライアント入力からサーバーにデータを送信するために、いくつかの要素(、、など)を使用していますinput
。select
textarea
データの処理中および送信プロセス中に、モーダルダイアログでユーザーに情報を提供し、画面をブロックします。
成功を送信し、すべてが正しく行われた後、「成功情報」を提供し、画面のブロックを解除します。
また、入力フィールドを消去 (リセット) する必要があります。フォームを使っていないので使えませんでしreset()
た。
私は次のJavaScriptでこれをやろうとしています:
function hedefiSifirla(anacElementID) {
var anacElement = (nY(anacElementID) ? nY(anacElementID) : anacElementID);
for (xi, xiLen = anacElement.children.length; xi < xiLen; xi++) {
var elm = anacElement.children[xi];
if (elm.hasChildNodes()) {
hedefiSifirla(elm)
}
if ((elm.tagName == 'input' && elm.type != 'checkbox') || elm.tagName == 'textarea') {
alert(elm.id);
elm.value = '';
}
if (elm.tagName == 'input' && elm.type == 'checkbox') {
elm.checked = false;
alert(elm.id);
}
if (elm.tagName == 'select') {
elm.options.length = 0;
alert(elm.id);
}
}
}
これはエラーログでは機能しませんでした。どこで私は間違えましたか?