diff --git a/app/static/js/hosts.js b/app/static/js/hosts.js
index 1a383042a7f9e34774d2c1e0771ea12f6aa4992a..97b96b36512c68f4f4dcc0f22757ff686da89c7f 100644
--- a/app/static/js/hosts.js
+++ b/app/static/js/hosts.js
@@ -49,7 +49,9 @@ $(document).ready(function() {
   // - add interface
   // Do NOT replace the IP on edit interface page load!
   // (we have to keep the existing IP)
-  if( $("#hostForm").length || $("#interfaceForm").length ) {
+  // Do NOT replace the IP if the form was submitted and an error was raised
+  // (we should display the same value that was submitted)
+  if( ($("#hostForm").length || $("#interfaceForm").length) && ! $("input").hasClass("is-invalid") ) {
     set_default_ip();
   }