Browse Source

Adds tab indexing an initial focus

devel
Jonathan Rosenbaum 10 years ago
parent
commit
88d717cdca
  1. 2
      Connections/database_functions.php
  2. 20
      css/contacts.css
  3. 20
      js/contact.js

2
Connections/database_functions.php

@ -58,7 +58,7 @@ $volunteer_interests = array(
"Repairing Bikes", "Organizing Volunteers", "Serving as a Board Member",
"Arranging Events", "Volunteering at Events", "Writing Grants",
"Answering our Phone", "Fundraising", "Bicycle Valeting",
"Publicizing", "Graphic Design", "Working at the Front Desk",
"Publicizing", "Graphic Design", "Greeter at the Front Desk",
"Accounting/Record Keeping", "Ordering parts/supplies", "Picking up Donated Bikes/Parts",
"Fabricating", "Open Source Programming", "Other/Contact me for general help",
);

20
css/contacts.css

@ -15,7 +15,7 @@
vertical-align: middle;
}
#interest_form {
#interest_form, #waiver {
padding: 10px;
display: block;
border: 1px solid rgb(173, 216, 230);
@ -25,6 +25,24 @@
margin-top: 0;
}
#submit_contact {
height: 36px;
width: 98px;
font-size: x-large;
}
#submit_contact:focus {
color: green;
}
#interest_form_button:focus {
color: green;
}
#waiver_button:focus {
color: green;
}
/* errors */
#waiver_error, #phone_error, #email_error,
#first_name_error, #last_name_error, #email_list_error

20
js/contact.js

@ -14,6 +14,7 @@ $(function(){
var zip = $("#zip");
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} } });
@ -23,7 +24,24 @@ $(function(){
recursive: true} } });
zip.mask('00000-0000', {placeholder: "00000-0000"});
state_abbreviation.mask('AA',{placeholder: "WV", translation: {"A": {pattern: /[A-Za-z]/, recursive: false} } });
// make tabbing more predictable
first_name.attr("tabindex",1);
last_name.attr("tabindex",2);
birth_date.attr("tabindex",3);
email.attr("tabindex",4);
phone.attr("tabindex",5);
$('[name="address1"]').attr("tabindex",6);
$('[name="city"]').attr("tabindex",7);
$('[name="state"]').attr("tabindex",8);
$('[name="zip"]').attr("tabindex",9);
$('[name="password"]').attr("tabindex",10);
$('#waiver_button').attr("tabindex",12);
$('#interest_form_button').attr("tabindex",13);
$('#submit_contact').attr("tabindex",14);
first_name.focus();
// spiff up contact pull down
var email_list_choice;
$("select[name='contact_id']").chosen();

Loading…
Cancel
Save