質問

RWDテーマの連絡先ページには、カーソルがこのボックスに入っているように、ページ上に着地したときに「名前」ボックスがあり、強調表示されます。あなたがこのページにアクセスするたびにあなたの顔にキーボードでヒットされているので、これはモバイルデバイスの迷惑です。アクティブである「名前」ボックスを無効にするにはどうすればよいですか?

役に立ちましたか?

解決

コードの変更:

<script type="text/javascript">
//<![CDATA[
    var contactForm = new VarienForm('contactForm', true);
//]]>
</script>
.

to:

<script type="text/javascript">
//<![CDATA[
    var contactForm = new VarienForm('contactForm', false);
//]]>
</script>
.

このファイルをチェックする js / varien / form.js

initialize: function(formId, firstFieldFocus){
        this.form       = $(formId);
        if (!this.form) {
            return;
        }
        this.cache      = $A();
        this.currLoader = false;
        this.currDataIndex = false;
        this.validator  = new Validation(this.form);
        this.elementFocus   = this.elementOnFocus.bindAsEventListener(this);
        this.elementBlur    = this.elementOnBlur.bindAsEventListener(this);
        this.childLoader    = this.onChangeChildLoad.bindAsEventListener(this);
        this.highlightClass = 'highlight';
        this.extraChildParams = '';
        this.firstFieldFocus= firstFieldFocus || false;
        this.bindElements();
        if(this.firstFieldFocus){
            try{
                Form.Element.focus(Form.findFirstElement(this.form))
            }
            catch(e){}
        }
    }
.

FirstFieldFocusをfalseに設定した場合、最初のフィールドにフォーカスが発生しません。

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top