diff --git a/form.js b/form.js
index df749369060abf4a530ddda3780300721c993f5b..28bd58ecfa6309397070919d7fb896476b02364e 100644
--- a/form.js
+++ b/form.js
@@ -28,9 +28,11 @@ function set_partition_change_handler() {
 
 function toggle_gpu_visibility(event) {
   const partition = event.target.value;
+  const cpu_selector = '#batch_connect_session_context_bc_num_slots';
   const gpu_selector = '#batch_connect_session_context_bc_num_gpus';
 
   toggle_visibilty_of_form_group(gpu_selector, table[partition]["max_gpu"] != -1);
+  set_max_value(cpu_selector, table[partition]["max_cpu"]);
   set_max_value(gpu_selector, table[partition]["max_gpu"]);
 }