Zbiór zmian 847 dla trunk/Wierszowki/Wierszowki.Web/Views/MagazineItem/Create.aspx
- Data:
- 2009-10-06 13:35:06 (17 years ago)
- Pliki:
-
- 1 zmodyfikowane
-
trunk/Wierszowki/Wierszowki.Web/Views/MagazineItem/Create.aspx (zmodyfikowane) (6 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/Wierszowki/Wierszowki.Web/Views/MagazineItem/Create.aspx
r846 r847 12 12 <script src="../../Scripts/jquery.validate.js" type="text/javascript" ></script> 13 13 <script src="../../Scripts/xVal.jquery.validate.js" type="text/javascript"></script> 14 <script src="../../Scripts/jqueryvalid.js" type="text/javascript"></script> 15 <script src="../../Scripts/xValCreateMagazineItem.js" type="text/javascript"></script> 14 16 </asp:Content> 15 17 … … 20 22 <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 21 23 <script type="text/javascript"> 22 $(function() { 23 24 $("#Magazine").change(function() { 25 var magazineId = $("#Magazine > option:selected").attr("value"); 24 $(document).ready(function() { 25 $("#Magazine_Id").change(function() { 26 var magazineId = $("#Magazine_Id > option:selected").attr("value"); 26 27 var urlAction = "<%= Url.Action("FindIssuesById", "Magazine") %>"; 27 28 urlAction = urlAction + "/" + magazineId; … … 29 30 $("#IssueId").addItems(data); 30 31 }); 31 }); 32 jQuery.validator.setDefaults({ 33 success: "valid" 34 }); 35 jQuery.validator.addMethod("DateCorrectFormat", function(data, element) { 36 return data.match(/^(19|20)\d\d(-)(0[1-9]|1[012])$/); 37 }, "Podaj prawid³ow¹ datê i format (0000-00)."); 38 39 jQuery.validator.addMethod("RangePrice", function(cena, element) { 40 return cena.match(/^((0([,]\d\d)?)|([1-9](\d){0,2}([,]\d\d)?)|([1]{1}[0]{3}([,][0]{2})?))$/); 41 },"Wymagany format to 0,00 , a wartoæ nie mo¿e byæ wiêksza ni¿ 1000."); 42 43 $("#myform").validate({ 44 rules: { 45 AuthorId: { required: true }, 46 IssueId: { required: true, min:1 }, 47 ItemTypeId: { required: true }, 48 Date: { required: true, DateCorrectFormat: true }, 49 Caption: { required: true, maxlength: 255 }, 50 Description: { maxlength: 255 }, 51 Bonus: { required: true, RangePrice: true}, 52 Price: { required: true, RangePrice: true} 53 }, 54 messages: { 55 AuthorId: { required: "Proszê wybraæ autora." }, 56 IssueId: { required: "Proszê wybraæ numer wydania. Musisz najpierw wybraæ Gazetê.", min: "Prosze wybraæ numer wydania. Musisz najpierw wybraæ Gazetê." }, 57 ItemTypeId: { required: "Proszê wybraæ typ wierszówki." }, 58 Date: { required: "Proszê podaæ miesi¹c"}, 59 Caption: { required: "Proszê podaæ tytu³ wierszówki.", maxlength: "Tytu³ jest za d³ugi." }, 60 Description: { maxlength:"Opis jest za d³ugi."}, 61 Bonus: { required: "Proszê wprowadziæ bonus do wierszówki."}, 62 Price: { required: "Proszê wprowadziæ wycenê wierszówki."} 63 } 64 }); 65 $("#myform").submit(function() { 66 $("#myform").valid(); 67 }); 68 }); 32 }); 33 }); 69 34 </script> 70 35 <h2>Dodaj wierszówkê</h2> … … 83 48 <div class="formitem"> 84 49 <label for="Magazine">Gazeta:</label> 85 <%= Html.DropDownList("Magazine ", ViewData.Model.MagazineList, "-- proszê wybraæ --")%>86 <%= Html.ValidationMessage("Magazine ", "*")%>50 <%= Html.DropDownList("Magazine.Id", ViewData.Model.MagazineList, "-- proszê wybraæ --")%> 51 <%= Html.ValidationMessage("Magazine.Id", "*")%> 87 52 <br /> 88 53 </div> … … 107 72 <div class="formitem"> 108 73 <label for="MagazineItem.Caption">Tytu³:</label> 109 <%= Html.TextBox("Caption", ViewData.Model.MagazineItem.Caption , new { title = "Proszê wprowadziæ tytu³ artyku³u." })%>74 <%= Html.TextBox("Caption", ViewData.Model.MagazineItem.Caption)%> 110 75 <%= Html.ValidationMessage("Caption", "*")%> 111 76 <br /> … … 113 78 <div class="formitem"> 114 79 <label for="MagazineItem.Description">Opis:</label> 115 <%= Html.TextArea("Description", ViewData.Model.MagazineItem.Description , new { title = "Proszê wprowadziæ opis artyku³u." })%>80 <%= Html.TextArea("Description", ViewData.Model.MagazineItem.Description)%> 116 81 <br /> 117 82 </div>
