$(document).ready(function(){ $("td #id_sessionmode").change(function() { if (this.value == 'TRIMP') { $("td #id_sessionunit").prop("value","None"); $('#id_guidance').html("

TRIMP has no unit

"); } if (this.value == 'distance') { $("td #id_sessionunit").prop("value","m"); $('#id_guidance').html("

Distance: Set value to meters

"); } if (this.value == 'time') { $("td #id_sessionunit").prop("value","min"); $('#id_guidance').html("

Time: Set value to minutes

"); } if (this.value == 'rScore') { $("td #id_sessionunit").prop("value","None"); $('#id_guidance').html("

rScore has no unit

"); } }); $("td #id_sessiontype").change(function() { if (this.value == 'session') { $("td #id_criterium").prop("value","none"); $('#id_guidance').html("

For Training Sessions, the default criterium is 'Approximately'

"); } if (this.value == 'test') { $("td #id_criterium").prop("value","exact"); $("td #id_sessionmode").prop("value","distance"); $("td #id_sessionunit").prop("value","m"); $('#id_guidance').html("

Set mode to distance. For Mandatory Tests, only distance or time are allowed.

For Mandatory Tests, the only criterium is 'Exactly'

"); } if (this.value == 'challenge') { $("td #id_criterium").prop("value","minimum"); $('#id_guidance').html("

For Challenges, the default criterium is 'At Least'

"); } if (this.value == 'cycletarget') { $("td #id_criterium").prop("value","none"); $('#id_guidance').html("

For Cycle Targets, the default criterium is 'Approximately'

"); } } ); $("td #id_sessionunit").change(function() { if (this.value == 'm') { $("td #id_sessionmode").prop("value","distance"); $('#id_guidance').html("

Mode was set to distance

"); } if (this.value == 'km') { $("td #id_sessionmode").prop("value","distance"); $('#id_guidance').html("

Mode was set to distance

"); } if (this.value == 'None') { $("td #id_sessionmode").prop("value","rScore"); $('#id_guidance').html("

Mode was set to rScore

"); } if (this.value == 'min') { $("td #id_sessionmode").prop("value","time"); $('#id_guidance').html("

Mode was set to time

"); } } ); });