サポート » プラグイン » MW WP Formで数字キーボードに設定したい

  • 解決済 tassi516

    (@tassi516)


    WordPress 5.1.1 で MW WP Form を使う際、電話番号ののフィールドを分かれさせず、かつスマートフォンで数字キーボードを表示させるようにしたいです。
    いろいろ試しましたが実現できません。
    いい方法はないでしょうか?

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • ishitaka

    (@ishitaka)

    こんにちは

    input タグに、inputmode 属性を指定する方法はどうでしょうか?
    https://qiita.com/ttake/items/da28d3a977e3bdb9d701

    フォーム:

    • 名前「電話番号」のテキストフォームタグを作成。
    • バリデーションルールで「電話番号」を指定。

    functions.php:

    function my_do_shortcode_tag( $output, $tag, $attr, $m ) {
    	if ( $tag == 'mwform_text' && $attr['name'] == '電話番号' ) {
    		$output = rtrim( substr( $output , 0 , -3 ) ) . ' inputmode="tel" />' . "\n";
    	}
    	return $output;
    }
    add_filter( 'do_shortcode_tag', 'my_do_shortcode_tag', 10, 4 );
1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック「MW WP Formで数字キーボードに設定したい」には新たに返信することはできません。