Skip to content
Snippets Groups Projects
Commit b6b884b3 authored by Matthew Juhl's avatar Matthew Juhl
Browse files

Fixed the birthday selectors

parent dd54f0b0
Branches
No related tags found
No related merge requests found
...@@ -455,13 +455,13 @@ if ($vars['title'] == "Edit profile") { ...@@ -455,13 +455,13 @@ if ($vars['title'] == "Edit profile") {
}*/ }*/
selhomeState.innerHTML = html; selhomeState.innerHTML = html;
$("select[name=form_data_profile_dob_month]").parent().append(selYear); $("input[name=form_data_profile_dob_month]").parent().append(selYear);
country_parent.append(selCountry); country_parent.append(selCountry);
state_parent.append(selState); state_parent.append(selState);
homecountry_parent.append(selhomeCountry); homecountry_parent.append(selhomeCountry);
homestate_parent.append(selhomeState); homestate_parent.append(selhomeState);
$("select[name=form_data_profile_dob_day]").insertBefore($("select[name=form_data_profile_dob_year]")); $("input[name=form_data_profile_dob_day]").insertBefore($("select[name=form_data_profile_dob_year]"));
// don't display the latitude/longitude fields // don't display the latitude/longitude fields
$("input[name=form_data_latitude],input[name=form_data_longitude]").parent().parent().hide(); $("input[name=form_data_latitude],input[name=form_data_longitude]").parent().parent().hide();
...@@ -499,6 +499,25 @@ if ($vars['title'] == "Edit profile") { ...@@ -499,6 +499,25 @@ if ($vars['title'] == "Edit profile") {
$('form select[name=form_data_profile_role] option[value='+unlrole+']').attr('selected','selected'); $('form select[name=form_data_profile_role] option[value='+unlrole+']').attr('selected','selected');
var dob_month = $("input[name=form_data_profile_dob_month]").val(),
dob_day = $("input[name=form_data_profile_dob_day]").val();
var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
var monthsHTML = "";
for (var i = 0, l = months.length; i < l; i++){
monthsHTML+= '<option value="' + months[i] + '">' + months[i] + '</option>';
}
$('form input[name=form_data_profile_dob_month]').replaceWith('<select name="form_data_profile_dob_month" class="input-pulldown">'+monthsHTML+'</select>');
$("select[name=form_data_profile_dob_month] option[value=" + dob_month + "]").attr("selected","selected");
var daysHTML = "";
for (var i = 1, l = 32; i < l; i++){
daysHTML+= '<option value="' + i + '">' + i + '</option>';
}
$('form input[name=form_data_profile_dob_day]').replaceWith('<select name="form_data_profile_dob_day" class="input-pulldown">'+daysHTML+'</select>');
$("select[name=form_data_profile_dob_day] option[value=" + dob_day + "]").attr("selected","selected");
$("#formloading").remove(); $("#formloading").remove();
$("#maincontent form.cool").show(); $("#maincontent form.cool").show();
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment