diff options
| author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-27 12:50:57 -0400 |
|---|---|---|
| committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-27 12:50:57 -0400 |
| commit | 1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe (patch) | |
| tree | c9d058cf973fe5eff0b8b815b5c4bc03eafe2c8e /webui_templates | |
| parent | 13012ff6cbbfa9e61911407210d33a32b4bed44d (diff) | |
| download | third_party-cobbler-1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe.tar.gz third_party-cobbler-1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe.tar.xz third_party-cobbler-1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe.zip | |
A small bit of javascript to ensure that the get_random_mac AJAX call, should it fail, will not
set the field to any value that is not a MAC address.
Diffstat (limited to 'webui_templates')
| -rw-r--r-- | webui_templates/system_edit.tmpl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/webui_templates/system_edit.tmpl b/webui_templates/system_edit.tmpl index c579970..d3a763c 100644 --- a/webui_templates/system_edit.tmpl +++ b/webui_templates/system_edit.tmpl @@ -20,7 +20,10 @@ function get_random_mac() xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { var mac_field = document.getElementById("mac") - mac_field.value = xmlHttp.responseText; + var result = xmlHttp.responseText; + if (result.charAt(2) == ':' && result.charAt(5) == ':') { + mac_field.value = result; + } } }; xmlHttp.send(null); |
