diff --git a/Connections/database_functions.php b/Connections/database_functions.php index d6f8319..56e94c5 100644 --- a/Connections/database_functions.php +++ b/Connections/database_functions.php @@ -418,7 +418,7 @@ function list_contacts_edit_add($form_name = "contact_id", $default_value = "") function list_contacts_select_user($form_name = "contact_id", $default_value = "") { echo "\n"; diff --git a/contact_add_edit.php b/contact_add_edit.php index 301739a..746c6e4 100644 --- a/contact_add_edit.php +++ b/contact_add_edit.php @@ -150,6 +150,13 @@ $totalRows_Recordset1 = mysql_num_rows($Recordset1); + + + +
+ + + diff --git a/css/contacts.css b/css/contacts.css index 9d8757e..9e7960c 100644 --- a/css/contacts.css +++ b/css/contacts.css @@ -4,4 +4,42 @@ #first_name_error, #last_name_error { color: red; -} \ No newline at end of file +} + +/* toggle for mailman or other email list */ +.toggle { + height: 50px; +} +.toggle.off .noUi-handle { + border-color: red; +} + +.toggle.on .noUi-handle { + border-color: green; +} + +/* get rid of the pesky handle stripping with specificity */ +#email_list_toggle > div > div > div.hello:before, #email_list_toggle > div > div > div.hello:after, +{ + content: none; +} + +.toggle.noUi-horizontal .noUi-handle { + width: 34px; + height: 20px; + top: -2px; +} + +.toggle.noUi-horizontal.noUi-extended { + padding-right: 32px; +} + +.toggle.noUi-horizontal.noUi-extended .noUi-handle { + left: -1px; +} +.toggle.noUi-horizontal.noUi-extended .noUi-origin { + right: -32px; +} + + + diff --git a/css/jquery.nouislider.css b/css/jquery.nouislider.css index 2ebc1bd..f1b0d63 100644 --- a/css/jquery.nouislider.css +++ b/css/jquery.nouislider.css @@ -126,6 +126,7 @@ inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB; } + /* Handle stripes; */ diff --git a/js/contact.js b/js/contact.js index 175fde2..03b438d 100644 --- a/js/contact.js +++ b/js/contact.js @@ -12,11 +12,12 @@ $(function(){ var state_abbreviation = $("#state_abbreviation"); // sensible defaults - first_name.mask('#',{placeholder: "first", translation: {"#": {pattern: /[A-Za-z0-9@.]/, recursive: true} } }); - last_name.mask('#',{placeholder: "last", translation: {"#": {pattern: /[A-Za-z0-9@.]/, recursive: true} } }); + first_name.mask('#',{placeholder: "first", translation: {"#": {pattern: /[A-Za-z0-9.\-]/, recursive: true} } }); + last_name.mask('#',{placeholder: "last", translation: {"#": {pattern: /[A-Za-z0-9.\-]/, recursive: true} } }); birth_date.mask("0000-00-00", {placeholder: "yyyy-mm-dd" }); phone.mask('(000) 000-0000', {placeholder: "(000) 000-0000"}); - email.mask('#',{placeholder: "_@_", translation: {"#": {pattern: /[A-Za-z0-9@.]/, recursive: true} } }); + email.mask('#',{placeholder: "_@_", translation: {"#": {pattern: /[A-Za-z0-9@._\-+~!\$&''\(\)\*,;=:\%}{]/, + recursive: true} } }); zip.mask('00000-0000', {placeholder: "00000-0000"}); state_abbreviation.mask('AA',{placeholder: "WV", translation: {"A": {pattern: /[A-Za-z]/, recursive: false} } }); @@ -44,8 +45,13 @@ $(function(){ email_error.hide(); phone_error.hide(); - phone_validator(phone.val(),e); - + var r = phone_validator(phone.val(),e); + if (r) { + if($("#email_list_toggle").val() == 1) { + console.log("here i am s" + r); + } + } + } else if ( (email.val() !== "" && phone.val() === "") ) { email_error.hide(); @@ -80,13 +86,17 @@ $(function(){ $('#waiver').slideUp(); $(this).attr("value","Show Waiver"); c--; - } }); + } + + }); function phone_validator(val, e) { var re = /^\(\d{3}\)\s?\d{3}-\d{4}$/; if ( !re.test(val) ) { error_handler(false, phone_error, false,"*Enter a correct phone number",e); + } else { + return true; } } @@ -121,5 +131,43 @@ $(function(){ return trans_error; } // end error_handling function + + + // email_list_toggle + function toggle( value ){ + $(this).toggleClass('off', value === "0"); + $(this).toggleClass('on', value === "1"); + } + + $("#email_list_toggle").noUiSlider({ + orientation: "horizontal", + start: 1, + range: { + 'min': [0, 1], + 'max': 1 + }, + format: wNumb({ + decimals: 0 + }) + }) + + $("#email_list_toggle").addClass('toggle'); + $("#email_list_toggle").addClass('noUi-extended'); + $("#email_list_toggle > div > div > div").addClass("hello"); + + $('.noUi-handle').hover(function(){ + $(this).attr('data-content','none'); + }); + + + $("#email_list_toggle").Link('lower').to(toggle); + $("#email_list_toggle").Link('lower').to('-inline-
', function(value) { + if (value == 0) { + $(this).html("no"); + } else if (value == 1) { + $(this).html("yes"); + } + }); + // end email_list_toggle }); \ No newline at end of file