HTML5 input patter for mac address

This commit is contained in:
luis daniel lucio quiroz
2014-12-23 01:06:20 +00:00
parent bc479c6053
commit cef63582d0
2 changed files with 2 additions and 2 deletions

View File

@@ -440,7 +440,7 @@ require_once "resources/require.php";
echo " ".$text['label-device_mac_address'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='device_mac_address' id='device_mac_address' maxlength='255' value=\"$device_mac_address\" pattern='^([0-9A-F]{2}[:-]?){5}([0-9A-F]{2})$' required='required'>\n";
echo " <input class='formfld' type='text' name='device_mac_address' id='device_mac_address' maxlength='255' value=\"$device_mac_address\" pattern='^([0-9A-Fa-f]{2}[:-]?){5}([0-9A-Fa-f]{2})$' required='required'>\n";
echo " <div style='display: none;' id='duplicate_mac_response'></div>\n";
echo " <div style='display: none;' id='duplicate_mac_found'></div>\n";
echo "<br />\n";

View File

@@ -1371,7 +1371,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
tb.className='formfld';
tb.setAttribute('id', 'device_mac_address');
tb.setAttribute('style', 'width: 80%;');
tb.setAttribute('pattern', '^([0-9A-F]{2}[:-]?){5}([0-9A-F]{2})$');
tb.setAttribute('pattern', '^([0-9A-Fa-f]{2}[:-]?){5}([0-9A-Fa-f]{2})$');
tb.value=obj.options[obj.selectedIndex].value;
document.getElementById('btn_select_to_input_device_mac_address').style.visibility = 'hidden';
tbb=document.createElement('INPUT');