You are on page 1of 2

function ShowPostalCodeRange() {

$('.showPostalCodeRange-link').click(function (event) {
event.preventDefault();
ShowPostalCodeRangeObj = $(this).children(":first");
$('<div id="ShowPostalCodeRange-dialog"/>').appendTo('body').dialog({
close: function (event, ui) {
$(this).dialog('destroy').remove();
},
title: "Add Postal Code Range",
modal: true,
draggable: true,
width: 400,
resizable: false,
buttons: {
"Add": function (e, ui) {
var $form = $("#ShowPostalCodeRangeForm");
$.validator.unobtrusive.parse($form);
if ($form.valid()) {
//ShipmentChangeAwbFormSubmit();
}

},
"Cancel": function () {
$("#ShowPostalCodeRangeForm").remove();
$(this).dialog('destroy').remove();
}
},
open: function (event, ui) {
$('.ui-widget-overlay').bind('click', function (event, ui) {
$('#ShowPostalCodeRange-dialog').dialog('close');
});
}
}).load($(this).children(":first")[0].href, {});
$.validator.unobtrusive.parse("#ShowPostalCodeRangeForm");
return false;
});
};

@model ShippingSystem.Models.ViewModels.RestrictedCountryPostalCodeModel

<form class="form-line" method="post" id="SHowPostalCodeRangeForm">


@Html.AntiForgeryToken()
<div class="form-group">
@Html.LabelFor(model => model.PostalCodeStart)
@Html.TextBoxFor(model => model.PostalCodeStart, new { @class = "form-
control" })
</div>
<div class="form-group">
@Html.LabelFor(model => model.PostalCodeEnd)
@Html.TextBoxFor(model => model.PostalCodeEnd, new { @class = "form-
control" })
</div>
</form>

public class RestrictedCountryPostalCodeModel


{
[Display(ResourceType = typeof(Res.ModelsItemsNames), Name =
"PostalCodeStart")]
public string PostalCodeStart { get; set; }
[Display(ResourceType = typeof(Res.ModelsItemsNames), Name =
"PostalCodeEnd")]
public string PostalCodeEnd { get; set; }
}

public ActionResult ShowPostalCodeRange()


{
var model = new RestrictedCountryPostalCodeModel();
return PartialView("_ShowPostalCodeRange", model);
}

You might also like