Hi All,
I wanted to pass Drop down list selected value in Ajax begin from kindly help,
Below is my code
@using (Ajax.BeginForm("AddNewStore", "StoreRegistration", new AjaxOptions { HttpMethod = "POST", OnSuccess = "successOfAddition", OnFailure = "failureOfAddition" }, new { id = "addStoreRegisterForm" }))
{
<div class="form-group col-md-6">
<div class="form-group">
<!--[if gte IE 9]><div class="input-group"><span class="input-group-addon">Store Number</span><![endif]-->
@*<input type="text" placeholder="Store Number" value="" name="storeno" class="form-control" />*@
<!--[if gte IE 9]></div><![endif]-->
@Html.DropDownListFor(x => x.StoreRegistrationAssociation.StoreIdentity, new SelectList(Model.StoreRegistrationAssociation.StoreIdentity, "Code", "Name", Model.StoreRegistrationAssociation.StoreIdentity), "Please Make a Selection", new { @class = "form-control", placeholder = "Please Make a Selection" })
@Html.ValidationMessageFor(x => x.StoreRegistrationAssociation.StoreIdentity)
</div>
</div>
<div class="form-group col-md-6">
<div class="form-group">
<!--[if gte IE 9]><div class="input-group"><span class="input-group-addon">Store Number</span><![endif]-->
@*<input type="text" placeholder="Store Number" value="" name="storeno" class="form-control" />*@
<!--[if gte IE 9]></div><![endif]-->
@Html.TextBoxFor(x => x.StoreRegistrationAssociation.StoreNumber, new { @class = "form-control", placeholder = "Store Number" })
@Html.ValidationMessageFor(x => x.StoreRegistrationAssociation.StoreNumber)
</div>
</div>
}
<div class="form-group">
<input type="reset" value="Cancel" />
<button type="submit" class="red-btn" data-dismiss="modal" id="btnRegisterStore">Agree</button>
</div>
On my button click i'm getting a store identity value as count =0 instead of selected value kindly help,
I have tried using ajax call i'mm getting the selected value but i'm not aware how to pass the selected value to form
@Html.DropDownListFor(x => x.StoreRegistrationAssociation.StoreIdentity, new SelectList(Model.StoreRegistrationAssociation.StoreIdentity, "Code", "Name", Model.StoreRegistrationAssociation.StoreIdentity), "Please Make a Selection", new { @class = "form-control",id="ddlIdentity", placeholder = "Please Make a Selection" })
function AdditionalsChanged() {
selIdentity = $("#ddlIdentity").val();
$("#ddlIdentity").val(selIdentity);
}
Join Hands Change lives
Thanks & Regards
Straight Edge Society