0

HttpPost を実行するビューがあります。

テキストボックスだけがある限り、正常に機能しています。日時ピッカーとドロップダウン リストを追加しました。日時ピッカーとドロップダウンをクリックすると、フォームが自動的に投稿されます。日時ピッカーとドロップダウン リストの詳細も表示されず、表示されたり消えたりして投稿を形成し、必要なエラー メッセージが表示されます。

日時ピッカーとドロップダウンは、jquery ウィジェットを使用して作成されます。

誰かがMVC4でフォームの自動投稿を停止する方法をアドバイスできますか?

以下は私の見解です:

@using P.B.O
@model O

 @using (Html.BeginForm("Create", "O", FormMethod.Post))
 {

@Html.ValidationSummary(true)
<fieldset>
    <legend>Create a New Organization</legend>

    <div class="editor-label">
        @Html.LabelFor(model => model.C) 
        @Html.TextBoxFor(model => model.C, new { @class = "txt"}) 
        @Html.ValidationMessageFor(model => model.C) 
    </div> <br />

    <div class="editor-label">
        @Html.LabelFor(model => model.N)
        @Html.TextBoxFor(model => model.N, new { @class = "txt"}) 
        @Html.ValidationMessageFor(model => model.N)
    </div> <br />

    <div class="editor-label">
        @Html.LabelFor(model => model.D)
        @Html.TextBoxFor(model => model.D, new { @class = "txt"}) 
        @Html.ValidationMessageFor(model => model.D)
    </div> 

    <div>
        <label for="check" class="chk">
            Del ?
            <input id="IsSoftDeleted" name="IsSoftDeleted" data-val-required="The Del? field is required." data-val="true" type="checkbox" class="check"  />
        </label>
    </div>

    <br />

  <input id="FromDate" name ="FromDate" data-val="true" type="datetime" class="datetime" />

        <input type="submit" value="Create" />
</fieldset>

}

4

0 に答える 0