Search-old
$(document).ready(function() {
checkSearchCount() ;
$("#div_checkboxes_special_needs").find("input").click(function() {
//alert(this.checked) ;
//alert($("form :checkbox[value='None']")[0].checked) ;
if (this.checked) {
//$("#Checkbox9").checked = false ;
$("form :checkbox[value='None']")[0].checked = false ;
}
}) ;
// accordion functions
var accordion = $("#stepForm").accordion();
var current = 0;
$.validator.addMethod("pageRequired", function(value, element) {
var $element = $(element)
function match(index) {
return current == index && $(element).parents("#sf" + (index + 1)).length;
}
if (match(0) || match(1) || match(2)) {
return !this.optional(element);
}
return "dependency-mismatch";
}, $.validator.messages.required)
var v = $("#dspForm").validate({
errorClass: "warning",
onkeyup: false,
onblur: false,
submitHandler: function() {
//alert("Submitted, thanks!");
submitSearch() ;
},
rules: {
alpha_firstname: "required",
alpha_lastname: "required",
alpha_zipcode: {
required: true,
digits: true ,
minlength: 5
},
alpha_email: {
required: true,
email: true
},
alpha_place_of_employment: "required",
alpha_phone_number : {
required: true,
phoneUS: true
},
alpha_home_address: "required"
},
messages: {
alpha_firstname: "Please enter your firstname",
alpha_lastname: "Please enter your lastname",
alpha_zipcode: "Please enter a valid zipcode",
alpha_email: "Please enter a valid email address",
alpha_place_of_employment: "Please enter your place of employment",
alpha_home_address: "Please enter your home address",
alpha_phone_number: "Please enter a valid phone number"
}
});
// back buttons do not need to run validation
$("#sf2 .prevbutton").click(function(){
accordion.accordion("activate", 0);
current = 0;
window.location.hash = '#formBegin';
});
$("#sf3 .prevbutton").click(function(){
accordion.accordion("activate", 1);
current = 1;
window.location.hash = '#formBegin';
});
$("#sf4 .prevbutton").click(function(){
accordion.accordion("activate", 2);
current = 2;
window.location.hash = '#formBegin';
});
// these buttons all run the validation, overridden by specific targets above
$(".open3").click(function() {
window.location.hash = '#formBegin';
if (v.form()) {
accordion.accordion("activate", 3);
current = 3;
}
});
$(".open2").click(function() {
window.location.hash = '#formBegin';
if (v.form()) {
accordion.accordion("activate", 2);
current = 2;
window.location.hash = '#formBegin';
$("#dt_birthdate_1").datePicker({startDate: '01/01/1970',endDate: (new Date()).asString()});
}
});
$(".open1").click(function() {
window.location.hash = '#formBegin';
if (v.form()) {
accordion.accordion("activate", 1);
current = 1;
window.location.hash = '#formBegin';
}
});
$(".open0").click(function() {
window.location.hash = '#formBegin';
if (v.form()) {
accordion.accordion("activate", 0);
current = 0;
window.location.hash = '#formBegin';
}
});
});
// Functions to validate US phone numbers
jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
phone_number = phone_number.replace(/\s+/g, "");
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
}, "Please specify a valid phone number");
//KL SELERUM - Modified date format to US format
Date.format = 'mm/dd/yyyy';
$(function() {
//$("#dt_birthdate_1").datePicker({startDate: '01/01/1970',endDate: (new Date()).asString()});
$("#dt_birthdate_2").datePicker({startDate: '01/01/1970',endDate: (new Date()).asString()});
$("#dt_birthdate_3").datePicker({startDate: '01/01/1970',endDate: (new Date()).asString()});
$("#dt_needing_care_1").datePicker();
$("#dt_needing_care_2").datePicker();
$("#dt_needing_care_3").datePicker();
//$("#alpha_firstname").datePicker();
});
function checkSearchCount() {
url = "/scripts/proxy.php?service=search_count"
$.ajax({
url: url,
cache: false,
success: function(html){
//alert(html) ;
//$("#divTarget").html(html) ;
$("#search_count").val(html) ;
updateSearchForm() ;
}
});
}
function updateSearchForm(){
if ($("#search_count").val() != ""){
$("#divForm").fadeOut('fast') ;
$("#divSearchLimitReached").fadeIn('slow');
$("#search_notes").show();
}else {
$("#divForm").fadeIn('fast') ;
}
}
function toggleNote(){
$("#search_notes").toggle('slow') ;
$("#divShowNote").toggle('slow');
return false ;
}
function submitSearch(){
var str = $("#dspForm").serialize();
url = "/scripts/proxy.php?service=search_submit&" + str
window.location.hash = '#search_result_begin';
$("#searchLoading").fadeIn('fast') ;
$.ajax({
url: url,
cache: false,
success: function(html){
//alert(html) ;
$("#search_result").html(html) ;
$("#searchLoading").fadeOut('fast') ;
if ($("#hid_limit_reached").val() != "") {
$("#search_count").val('reach') ;
updateSearchForm();
}
if ($("#hid_result_count").val() > "0"){
$("#divForm").fadeOut('fast') ;
$("#dspForm").each(function(){this.reset();});
if ($('#search_notes').is(':visible')) {
//toggleNote() ;
}
}
}
});
}
IMPORTANT Child Care Search Notes:
- You can search up to 4 times
- Search fields reset after each search – Please check information carefully
- Referrals shown are randomly selected
- Listings MAY NOT include all possible options
The referrals given are NOT recommendations.
We highly recommend, however, that you check on the complaint history
of the programs you are interested in:
Child Care Center and Family Child Care Licensing
650-266-8843
For more detailed referrals, please contact a Resource and Referral Specialist:
It appears that you have reached the search limit for the current year
Please contact one of the above Resource and Referral Specialists for more information & referrals

Searching data, please wait…
function handleNeedsNone(ck) {
if(ck.checked){
$("#div_checkboxes_special_needs").find("input").each(function() {
//alert(this.checked) ;
this.checked = false ;
}) ;
}
}
Leave a Reply
Your email address will not be published / Required fields are marked *