|
Lines 191-196
function write_age() {
Link Here
|
| 191 |
hint.html(age_string); |
191 |
hint.html(age_string); |
| 192 |
} |
192 |
} |
| 193 |
|
193 |
|
|
|
194 |
function toggleRelationshipRequired() { |
| 195 |
const relationshipField = $('.relationship'); |
| 196 |
const label = relationshipField.parent().find('label'); |
| 197 |
const requiredIndicator = relationshipField.parent().find('span.required'); |
| 198 |
|
| 199 |
if (!$('#contactname').val() && !$('#contactfirstname').val()) { |
| 200 |
label.removeClass('required'); |
| 201 |
requiredIndicator.hide(); |
| 202 |
relationshipField.removeAttr('required'); |
| 203 |
} else { |
| 204 |
label.addClass('required'); |
| 205 |
requiredIndicator.show(); |
| 206 |
relationshipField.attr('required', 'required'); |
| 207 |
} |
| 208 |
} |
| 209 |
|
| 194 |
$(document).ready(function(){ |
210 |
$(document).ready(function(){ |
| 195 |
if($("#yesdebarred").is(":checked")){ |
211 |
if($("#yesdebarred").is(":checked")){ |
| 196 |
$("#debarreduntil").show(); |
212 |
$("#debarreduntil").show(); |
|
Lines 221-226
$(document).ready(function(){
Link Here
|
| 221 |
$(this).parents('fieldset').first().remove(); |
237 |
$(this).parents('fieldset').first().remove(); |
| 222 |
}); |
238 |
}); |
| 223 |
|
239 |
|
|
|
240 |
if (mandatory_fields.includes('relationship')) { |
| 241 |
toggleRelationshipRequired(); |
| 242 |
if ($('#contactname').length) { |
| 243 |
$('#contactname').on('change', toggleRelationshipRequired); |
| 244 |
} |
| 245 |
if ($('#contactfirstname').length) { |
| 246 |
$('#contactfirstname').on('change', toggleRelationshipRequired); |
| 247 |
} |
| 248 |
} |
| 249 |
|
| 224 |
$(document.body).on('change','.select_city',function(){ |
250 |
$(document.body).on('change','.select_city',function(){ |
| 225 |
var selected_city = $(this).val(); |
251 |
var selected_city = $(this).val(); |
| 226 |
var addressfield = $(this).data("addressfield"); |
252 |
var addressfield = $(this).data("addressfield"); |
| 227 |
- |
|
|