Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
// jquery.tools validation with twitter bootstrap layout var validation_results_selector = '#validation-results-top, #validation-results-bottom'; // Required inputs $toolsvalidatorfn"input.required, select.required""can't be blank"functioninputvalue return !inputis':visible' || value != ''; ; // Agreement checkboxes $toolsvalidatorfn'input[type="checkbox"].required'"<b>(Must be checked)</b>"functioninputvalue return !inputis':visible' || inputis':checked'; ; // Date pickers $toolsvalidatorfn"input.date-picker.today-or-in-the-future""can't be in the past"functioninputvalue return !inputis':visible' || value == '' || Dateparsevalue > Datenow - 24*60*60*1000; ; // Riders (input type = 'radio') $toolsvalidatorfn'input:radio'"must be selected"functioninputvalue var value = $'input:radio[name="'+ inputattr'name' +'"]:checked'val; // Escaped input name with double quotes (AGordikov 09/10/2012) return value != null; ; // User password $toolsvalidatorfn'#new_user_password_confirmation'"doesn't match password"functioninputvalue var element = $'#' + inputattr'data-match-field'; return elementsize == 0 || elementval == value; ; // User email $toolsvalidatorfn'#new_user_email'functioninputvalue if inputis':visible' && value == '' return false; // do not send request if field is empty // verify email format var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if !retestvalue return false; // if value is present and format matches, send request to server $ajax type: "GET" url: "/policies/ajax_validate_email" timeout: 5000// 5 seconds data: email: value donefunction json_result if json_result.error != null // validation error $'form#policy_form'data'validator'invalidate'new_user[email]': json_result.error; else // success .error // server error, timeout etc //$('form#policy_form').data('validator').invalidate({'new_user[email]': 'Server '+json_result.statusText}); ; return true; ; // Month validator $toolsvalidatorfn"select.month""can't be in the past"functioninputvalue var month = null; var year = null; if value <= 12 // Month selected month = parseIntvalue; year = parseIntinputnext"select"val; else // Year selected month = parseIntinputprev"select"val; year = parseIntvalue; var today = ; return year > todaygetFullYear || year == todaygetFullYear && month >= todaygetMonth+1; ; // scrolls page to given element $"html, body"animatescrollTop:elementoffsettop'ease'; // Disable invisible inputs so they are not validated. $'input:visible, select:visible'removeAttr"disabled"; // 1. enable inputs in expanded sections $'input:not(:visible):not([type=hidden]), select:not(:visible)'attr"disabled""disabled"; // 2. then disable inputs in collapsed sections $selectoreach var form = $this; var validation_results = $validation_results_selector; formfind'input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="checkbox"], input:radio, select' focusfunction // Andrew K. I haven't found how to reset field error yet. blurfunction var validator = $thisparents'form'data'validator'; if validator != null validatorcheckValidity$this; ; form validator errorInputEvent: 'change' disable_hidden_options; submitfunctione // onsubmit handler if !eisDefaultPrevented // form is valid validation_resultshide; else // form with errors validation_resultsshow; scrollTo$'div.control-group.error:visible:first'first; bind'reset.validator' remove_all_validation_markupform; validation_resultshide; bind'onSuccess' $eachokfunction var input = $this; remove_validation_markupinput; // uncomment next line to highlight successfully // validated fields in green //add_validation_markup(input, 'success'); ; bind'onFail' $eacherrorsfunction var err = this; var input = $errinput; remove_validation_markupinput; add_validation_markupinput'error' errmessagesjoin' '; ; return false; // skip other errors ; ; //stops the a href event from bubbling up if an info help-icon is clicked on $documentclickfunctione ifeoriginalEventsrcElement && eoriginalEventsrcElementclassName == 'icon icon-info-sign' return false; return inputparents'div.control-group'; var cont = find_containerinput; contremoveClass'error success warning'; $'.help-inline.error, .help-inline.success, .help-inline.warning'contremove; var cont = find_containerinput; contaddClasscls; inputaddClasscls; if caption var msg = $'<span class="help-inline"/>'; msgaddClasscls; msghtmlcaption; var asterisk = inputnext"abbr"; var second_select = inputnext"select"; var last_radio = inputclosest'label.radio'siblings'label.radio:last'; if asterisksize > 0 // Checkboxes asteriskaftermsg; else if second_selectsize > 0 // Month control second_selectaftermsg; else if last_radiosize > 0 last_radioaftermsg; else inputaftermsg; $'.help-inline.error, .help-inline.success, .help-inline.warning'formremove; $'.error, .success, .warning'form removeClass'error success warning'; |