2017-01-24 9 views
-1

ユーザーが入力を開始するときに、プロダクトオプションテキストフィールドから「これは必須フィールドです」というメッセージを非表示(削除)したいと考えています。Magento 1.7 /タイピングを開始するときに「これは必須フィールドです」を削除するには?

document.getElementsByClassName("product-custom-option").onclick = function(){ 
    document.getElementById("advice-required-entry-select_"+this.id).remove(); 
}; 

しかし、それは動作しません。ここで

は、これまでのところ、私の試みです。 onblur、onfocusを、onkeypressではあなたが設定することができます代わりにonclickの

+0

を、必要なエントリークラスを削除します。 –

+0

"それは動作しません"より明示的に定義してください –

答えて

0

使用することは、その製品の管理者からの要求されます。またはあなたがちょうどあなたが別のイベントを使用する必要があるというカスタムオプションフィールドから

0

のテキストフィールドの

0
function req(option_id) { 
var e = document.getElementById("select_"+option_id); 
var selectedValue = e.options[e.selectedIndex].text; 
if(selectedValue == '-- Please Select --') { 
    document.getElementById("select_"+option_id).className = "required-entry product-custom-option validation-failed"; 
    if(document.getElementById("advice-required-entry-select_"+option_id)) { 
     if(document.getElementById("advice-required-entry-select_"+option_id).style.display == 'none') { 
      document.getElementById("advice-required-entry-select_"+option_id).style.display = 'block'; 
     } 
    } 
} 
if(selectedValue && selectedValue !== '-- Please Select --') { 
    document.getElementById("select_"+option_id).className = "required-entry product-custom-option"; 
    //document.getElementById("advice-required-entry-select_"+option_id).remove(); 
    if(document.getElementById("advice-required-entry-select_"+option_id)) { 
     document.getElementById("advice-required-entry-select_"+option_id).style.display = 'none'; 
    } 
} 

}

関連する問題