Permalink
Browse files

Phone Number changes for new enum.

  • Loading branch information...
1 parent d708534 commit 72f815efc369a91d5cdeb9119809419b68790bb0 @chrisjdiver chrisjdiver committed Oct 22, 2011
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/GiveCRM.Web/Views/Member/Add.cshtml
@@ -51,11 +51,13 @@
</div>
<div id="AddNumber">
- <label for="AddNumber_Type">Number Type</label><select id="AddNumber_Type" name="AddNumber_Type">
- <option value="Home">Home</option>
- <option value="Mobile">Mobile</option>
- <option value="Work">Work</option>
- </select><br />
+ <label for="AddNumber_Type">Number Type</label>
+ <select id="AddNumber_Type" name="AddNumber_Type">
+ @foreach(int phoneType in Enum.GetValues(typeof(GiveCRM.Models.PhoneNumberType)))
+ {
+ <option value="@phoneType">@Enum.GetName(typeof(GiveCRM.Models.PhoneNumberType), @phoneType)</option>
+ }
+ </select><br />
<label for="AddNumber_Number">Number</label><input id="AddNumber_Number" name="number" type="text" />
<input id="AddNumber_Button" type="button" value="Add Number" /><br />
</div>
@@ -70,7 +72,7 @@
$(function () {
$('#AddNumber_Button').click(function () {
var index = $('.numbertype').length;
- var type = HtmlEncode($('#AddNumber_Type option:selected').attr('value'));
+ var type = HtmlEncode($('#AddNumber_Type option:selected').text());
var number = HtmlEncode($('#AddNumber_Number').val());
$('#AddNumber_Number').val('');
if (number.trim() === '')

0 comments on commit 72f815e

Please sign in to comment.