更改联系人fom7中日期字段的占位符文本

问题描述 投票:0回答:2

在wordpress网站创建联系人我给了日期字段的占位符文本,但仍显示为mm / dd / yyyy。如何将此mm / dd / yyyy更改为Text。

<div class="form-group col-md-6">[date* preferreddate min:2017-01-01 max:2018-12-31 class:c-input class:brd-grey placeholder "Preferred Appointment Date"]</div>
wordpress
2个回答
0
投票

您可以使用此短代码,因为默认所有日期参数都不起作用。所以,你可以尝试使用,

<div class="form-group col-md-6">[date* placeholder "Preferred Appointment Date"]</div>

而其他风格由css管理。

谢谢


0
投票

通过在联系表单7中为占位符文本添加此代码以解决日期问题。

$('input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"]').each(function() {
var el = this, type = $(el).attr('type');
if ($(el).val() == '') $(el).attr('type', 'text');
$(el).focus(function() {
    $(el).attr('type', type);
    el.click();
});
$(el).blur(function() {
    if ($(el).val() == '') $(el).attr('type', 'text');
});
});
© www.soinside.com 2019 - 2024. All rights reserved.