Phonegap iOS 10 输入类型 "date" 无法显示值
Phonegap iOS 10 input type "date" not able to show value
我正在 phonegap/cordova 中创建应用程序,我已经创建了输入类型为 - 文本、日期的表单。
所以
<input placeholder="DOB" type="date" class="form-control profile-page-dob" >
以上 html 在 iOS 10 之前支持,但当我更新 iphone 6s 时,本地日期选择器显示但我给 "type=date" 的值不显示但价值在那里(当我通过 alert($(".profile-page-dob").val())
检查时,即 1996-05-01 )。
如果哪位专家有什么消息请告诉我。
谢谢
我刚刚发现了一些棘手的方法,因为 ios10 正在显示所选日期的值但占位符正在工作然后我只是使用 change,focusin 和 focusout[= 在占位符属性中附加值14=] 处理日期选择器值的函数。
$(".profile-page-dob").change(function(){
// alert(1)
$(this).attr('type','date')
$(this).attr('placeholder',$(this).val())
$(this).attr('value',$(this).val())
$(this).val($(this).val());
userDob = $(this).val();
// alert($(".profile-page").html())
})
$(".profile-page-dob").focusin(function(){
$(this).attr('type','date')
$(this).attr('placeholder',$(this).val())
$(this).attr('value',$(this).val())
$(this).val($(this).val())
userDob = $(this).val();
})
$(".profile-page-dob").focusout(function(){
$(this).attr('type','date')
$(this).attr('placeholder',$(this).val())
$(this).attr('value',$(this).val())
$(this).val($(this).val())
userDob = $(this).val();
})
我正在 phonegap/cordova 中创建应用程序,我已经创建了输入类型为 - 文本、日期的表单。 所以
<input placeholder="DOB" type="date" class="form-control profile-page-dob" >
以上 html 在 iOS 10 之前支持,但当我更新 iphone 6s 时,本地日期选择器显示但我给 "type=date" 的值不显示但价值在那里(当我通过 alert($(".profile-page-dob").val())
检查时,即 1996-05-01 )。
如果哪位专家有什么消息请告诉我。
谢谢
我刚刚发现了一些棘手的方法,因为 ios10 正在显示所选日期的值但占位符正在工作然后我只是使用 change,focusin 和 focusout[= 在占位符属性中附加值14=] 处理日期选择器值的函数。
$(".profile-page-dob").change(function(){
// alert(1)
$(this).attr('type','date')
$(this).attr('placeholder',$(this).val())
$(this).attr('value',$(this).val())
$(this).val($(this).val());
userDob = $(this).val();
// alert($(".profile-page").html())
})
$(".profile-page-dob").focusin(function(){
$(this).attr('type','date')
$(this).attr('placeholder',$(this).val())
$(this).attr('value',$(this).val())
$(this).val($(this).val())
userDob = $(this).val();
})
$(".profile-page-dob").focusout(function(){
$(this).attr('type','date')
$(this).attr('placeholder',$(this).val())
$(this).attr('value',$(this).val())
$(this).val($(this).val())
userDob = $(this).val();
})