【问题标题】:Can't type in textfield with placeholder and ng-model (only in safari)无法使用占位符和 ng-model 输入文本字段(仅在 safari 中)
【发布时间】:2016-06-29 12:21:54
【问题描述】:

当我在第一个字段中输入文本时,文本会显示出来。使用选项卡或鼠标转到下一个字段后,该字段保持空白。这适用于除第一个字段之外的所有字段。

我有以下 HTML:

<form name="HomeAccountForm" ng-submit="HomeAccountForm.$valid && fModel.accept && submit()" novalidate>


  <input name="firstname" type="text" placeholder="Voornaam*" ng-model="fModel.firstname" required>
  <input name="lastname" type="text" placeholder="Achternaam*" ng-model="fModel.lastname" required>
  <input name="profilename" type="text" placeholder="Profielnaam*" ng-model="fModel.profilename" required>
  <input name="email" type="email" placeholder="Email*" ng-model="fModel.email" required>

  <input name="password" type="password" placeholder="Wachtwoord*" ng-model="fModel.password" required>
  <input name="passwordCheck" type="password" compare-to="fModel.password" placeholder="Wachtwoord herhaling*" ng-model="fModel.passwordCheck" required>


  <input type="checkbox" id="accept" name="accept" ng-model="fModel.accept" />
      <label for="accept">Ik ben 18 jaar of ouder en ga akkoord met de <a href="/#/">Algemene Voorwaarden.</a>*</label>

  <input type="submit" class="button" ng-disabled="!HomeAccountForm.$valid || !fModel.accept" value="Bevestigen">

</form>

如果我删除占位符,一切正常。当我删除所有 ng-model 时,同样适用。

但这仅发生在 safari(桌面/IOS)中。

我还测试了 Firefox、IE8、IE9、IE10、Chrome 和 safari 技术预览版,但这里一切正常。

在图像中,我正在输入所有字段。仅在文本中的第一个结果中

【问题讨论】:

    标签: javascript html angularjs safari


    【解决方案1】:

    根据http://www.w3schools.com/tags/att_input_placeholder.asp 不支持最新版本的safari。

    【讨论】:

    • 在 safari 和占位符方面从来没有任何问题。我猜它的组合。
    猜你喜欢
    • 2014-06-14
    • 2012-07-07
    • 1970-01-01
    • 2011-11-14
    • 2023-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-01
    相关资源
    最近更新 更多