以下に示すように、Razor 構文の登録フォームがあります。
<div id="RegisterDiv" class="is-hidden">
@using (Html.BeginForm("Register", "User", FormMethod.Post, new { id = "frmRegister" }))
{
<label>Email</label>
@Html.TextBoxFor(lm => lm.Email, new { id = "Email", name = "Email", value = "", placeholder = "Enter your email" })
<small id="Emailerror" class="error is-hidden">A valid email address is required</small>
<label>Password</label>
@Html.PasswordFor(lm => lm.Password, new { id = "Password", name = "Password", value = "", maxlength = "20" })
<small id="Passworderror" class="error is-hidden"></small>
@Html.PasswordFor(lm => lm.VerifyPassword, new { id = "VerifyPassword", name = "VerifyPassword", value = "", maxlength = "20" })
<small id="VerifyPassworderror" class="error is-hidden"></small>
<small class="help-block">* must be 6-20 characters (letters, numbers and hyphens are accepted but not spaces)</small>
<hr>
<div class="form-row">
<div class="six columns">
@Html.TextBoxFor(lm => lm.FirstName, new { id = "FirstName", name = "FirstName", value = "", placeholder = "First Name" })
<small id="FirstNameerror" class="error is-hidden">First name is required</small>
</div>
<div class="six columns">
@Html.TextBoxFor(lm => lm.LastName, new { id = "LastName", name = "LastName", value = "", placeholder = "Last Name" })
<small id="LastNameerror" class="error is-hidden">Last name is required</small>
</div>
</div>
<div class="form-row">
<div class="six columns">
@Html.DropDownListFor(dr => dr.CountryId, new SelectList(Model.CountryList, "countryid", "name"), "Country of Residence", new { id = "CountryId", name = "CountryId" })
<small id="CountryIderror" class="error is-hidden">Country is required</small>
</div>
</div>
<div class="form-action">
<a id="Submit" class="form-submit" href="javaScript:void(0);">Register</a>
<a id="Cancel" class="form-cancel" href="javaScript:void(0);">Cancel</a>
</div>
}
</div>
そして提出コードは
$("#frmRegister").submit();
しかし、アプリケーションが IE-8 で実行されている場合、要素 id=" Password " および id=" VerifyPassword " の値はサーバーに送信されません。プレースホルダー属性を削除すると、正常に機能します。つまり、データはサーバーに送信されます。プレースホルダー属性を削除せずにこの問題を解決する方法はありますか? そうでない場合、 like 以外のプレースホルダーを保持する別の方法はありplaceholder = "Verify Password"
ますか?