Skip to content
Snippets Groups Projects
Commit 68c95436 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Do not replace the IP if an error was raised

If an error is raised when submitting the form, we should keep the IP
that was entered.

JIRA INFRA-285
parent 343fbdb0
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,9 @@ $(document).ready(function() { ...@@ -49,7 +49,9 @@ $(document).ready(function() {
// - add interface // - add interface
// Do NOT replace the IP on edit interface page load! // Do NOT replace the IP on edit interface page load!
// (we have to keep the existing IP) // (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(); set_default_ip();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment