Use SpryValidationTextField to check MAC address

Goal: I would like to have a data entry check in a text field
that confirms a properly formed MAC address was entered.
My attempt: I created a SpryValidationTextField of type
custom with a pattern 00-00-00-00-00-00 and 'Enforce Pattern'
ticked. The issue is that the system will not allow me to enter
letters A-F for hexadecimal vlaues but only digits 0-9.
Vice versa if I enter the pattern AA-AA-AA-AA-AA-AA the
system will not allow me to enter any digits 0-9 but all
characters.
What I need is a check that allows all values 0-9/A-F with
letters preferably automatically converted to capital letters, when
entered in small characters, while preserving the integrity of the
pattern 00-00-00-00-00-00.
Can anyone help?

A slight modification to the suggestions and it now works
perfect. The improvement handles the error messaging perfectly well
but also ensures that a complete MAC address is entered ( the
preliminary solution given below allowed accepted a MAC address of
16 characters as valid).
Thanks for cw2ureg and V1 Fusion for their input. All credit
to them
HTML:
<span id="sprytextfield1">
<input type="text" name="mac" value="" size="17" />
<span class="textfieldRequiredMsg">A value is
required.</span><span
class="textfieldMinCharsMsg">Minimum number of characters not
met.</span><span class="textfieldMaxCharsMsg">Exceeded
maximum number of characters.</span><span
class="textfieldInvalidFormatMsg">Not a valid MAC
address</span></span>
Constructor:
var sprytextfield1 = new
Spry.Widget.ValidationTextField("sprytextfield1", "none",
{validation: fnValidateMacAddress, validateOn:["blur"],
hint:"00-00-00-00-00-00", minChars:17, maxChars:17});
Function:
function fnValidateMacAddress(macaddr) {
var reg1 =
/^[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2}\-[A-Fa-f0-9]{1,2 }\-[A-Fa-f0-9]{1,2}$/;
var reg2 =
/^[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2}\:[A-Fa-f0-9]{1,2 }\:[A-Fa-f0-9]{1,2}$/;
if (reg1.test(macaddr)) {
return true;
}else if (reg2.test(macaddr)) {
return true;
} else {
return false;

Similar Messages

  • How to check MAC address from host from local network

    Hello,
    I must save information about my network enviroment, at some periods of time (IP, Host Name, MAC Address, and later some information from SNMP). I have IP addresses of all devices. Could any one have an idea how to check MAC address. In java.net.* I didn't find anythink about my problem.
    Please give my an answer, if you konow any solution.
    Marcin Kowalski

    hi !
    I've typed ipconfig on my PC which has windows2000 pro. as the OS!!
    but i couldn't get th line you've mentioned "Physical Address" !!
    what could be wrong .. ?!! hope you could help!!
    thanks!!
    C:\>ipconfig
    Windows 2000 IP Configuration
    Ethernet adapter
    Connection-specific DNS Suffix . :
    IP Address. . . . . . . . . . . . : 10.130.128.210
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . : 10.130.128.1

  • Using ACS to authenticate mac addresses

    I am wanting to use ACS 3.3 to be the authentication source for mac address authentication on a WLAN. All AP's are 1200's. Configuring the AP to look to to ACS box seems pretty straight forward. But how do you configure the ACS box. Do you just enter the mac address as the user name? What do you enter as the password?

    You have to use the MAC address for both user id and password. This MAC address should be in the same format seen by the AP.
    Please go to "MAC Authentication" portion of the following document for more information http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_configuration_example09186a00805e7a13.shtml
    http://www.cisco.com/en/US/products/hw/wireless/ps430/products_configuration_guide_chapter09186a008010f63d.html#wp1029067
    HTH

  • How can check ip of network printer? how can check MAC address?

    hello,
    my printer name is,
    HP Laserjet 1022n
    product no. Q5913A
    serial no. VNRT79T074
    give me a details of the issue
    mittal sagar

    Hi,
    You may locate both the Mac Address and the IP Address by prinitng a Configuration Page.
    You may fnd the steps to print the report listed below:
    http://h10025.www1.hp.com/ewfrf/wc/document?lc=en&dlc=en&cc=us&docname=c01125585
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Use SpryValidationTextField to check Currency Decimals

    I have a SpryValidationTextField widget defined in my form to
    see whether a currency field has a certain minimum value. It works
    fine as lomg as I integer values as minimum values. As soon as I
    use decimals the valuation starts going horrorably wrong; the
    system will allow any value to pass really, as long as they have
    the correct format.
    I assume this is a bug of the validation function.
    Can an Adobe member of the forum please suggest an
    appropriate fix or point out what I am doing wrong.
    <span id="sprytextfield1">
    <input type="text" name="cost" id="cost" value="0.00"
    size="32" />
    <span class="textfieldRequiredMsg">A value is
    required.</span><span
    class="textfieldInvalidFormatMsg">Invalid
    format.</span><span class="textfieldMinValueMsg">The
    entered value is less than the minimum
    required.</span><span class="textfieldMaxValueMsg">The
    entered value is greater than the maximum
    allowed.</span></span>
    <script type="text/javascript">
    <!--
    var sprytextfield1 = new
    Spry.Widget.ValidationTextField("sprytextfield1", "currency",
    {validateOn:["blur"], minValue:0.5, maxValue:1000,
    useCharacterMasking:true, hint:"Cost in account currency"});
    //-->
    </script>

    This looks like it may be a bug in the
    SpryValidationTextField code. You can work around the problem by
    quoting your min and max values and if you are going to specify a
    digit after the decimal point, make sure there are 2 digits. So in
    your example, change:
    minValue: 0.5
    to
    minValue: "0.50"
    --== Kin ==--

  • Blocking all MAC addresses except for the ones you allow

    I have a Cisco Aironet 1200 Access Point. I want to block all MAC addresses from accessing the access point, except for the ones I've allowed. First I went to the Address Filters page and clicked on Allowed, then listed all the MAC address I want to be able to access the access point. Then I went to the Ethernet Advanced page, and set the Default Multicast Address Filter to Disallowed, and the Default Unicast Address Filter to Disallowed. Then I went to the AP Radio: Internal Advanced page, clicked on the Advanced Primary SSID Setup link, and set the Default Unicast Address Filter to Disallowed. Accept Authentication Type is set to Open with Shared and Network-EAP cleared, and the Require EAP check boxes are all cleared.
    When using a computer whose MAC address is not listed on the Address Filters page, I am still able to connect to the network through the access point. I am also able to connect to the access point from any pc on my network by entering its IP address in Internet Explorer.
    What do I need to do to block any pc without a listed MAC address from connecting to the access point?
    Thanks, Jeff

    Here's the instructions and URL on how to create an MAC based filter:
    Follow these steps to create a MAC address filter:
    Step 1 Follow the link path to the Address Filters page.
    Step 2 Type a destination MAC address in the New MAC Address Filter: Dest
    MAC Address field. You can type the address with colons separating the character pairs
    (00:40:96:12:34:56, for example) or without any intervening characters (004096123456, for example).
    Note If you plan to disallow traffic to all MAC addresses except
    those you specify as allowed, put your own MAC address in the list of allowed MAC
    addresses. If you plan to disallow multicast traffic, add the broadcast MAC address
    (ffffffffffff) to the list of allowed addresses.
    Step 3 Click Allowed to pass traffic to the MAC address or click Disallowed
    to discard traffic to the MAC address.
    Step 4 Click Add. The MAC address appears in the Existing MAC Address
    Filters list. To remove the MAC address from the list, select it and click Remove.
    Step 5 Click OK. You return automatically to the Setup page.
    Step 6 Click Advanced in the AP Radio row of the Network Ports section at
    the bottom of the Setup page for the radio you want to configure. The AP Radio Advanced page appears.

  • Getting Mac Address of Windows 7 Machine

    Hi all,
    Our application used to gather the Mac address of the client machine. For this purpose, i was using the Java bean(ClientInfos.fmb) to get the information. It used to work fine until
    the OS was Windows XP. As soon as the Windows 7 has come, the application/java bean could not collect the mac address.
    Pls let me know if there is any working for this problem.
    Even if there is any other alternative, I would love to adopt.
    One of the solution, I was thinking that to run a client_host command using webutil, write the output in a notepad. Get the mac address from the notepad.
    If it is possible, give me some clue,so that i can fight it down.
    Thanks & Regards,
    Alok Dubey

    There are likely several ways to accomplish this. You will need a custom java bean or webutil. WebUtil does not have a built-in function that can do what you want, but it will give you access to the system and/or registry. The problem with which you are faced is that some machines may have more than one net adapter and therefore more than one mac. Anyway.... you can use the CLIENT_HOST command to execute this Windows command:
    GETMAC*
    You can also execute GETMAC /NH+ and the data will be displayed without the column headers. If you write this info to a temp text file on the client, you can then read it with CLIENT_TEXT_IO. Use the pl/sql substr function to exact whatever part of the info you want to use.
    More info about the above command can be found on the MS website here:
    http://technet.microsoft.com/en-us/library/bb490913.aspx

  • Where can I find the MAC address on ATV3?

    My internet provider is requesting the MAC address of from the Apple TV 3 I'm trying to hook up.   It is not plainly listed anywhere.  Is there another name for this address?  Where can I find it?
    Thanks,
           Pterodroma

    There will be two MAC addresses.
    One for wi-fi and one for ethernet.
    It should be listed under Settings>General>About, depending on which you are using.
    If you have ethernet cable plugged in wifi is disabled so it should be the ethernet address.  If ethernet unplugged it should give the wifi Mac address.
    Apple used to put the MAC address on teh product box, but for some daft reason had not done so with either the latest iPad or AppleTV3.
    Send feedback:
    http://www.apple.com/feedback/appletv.html

  • Controller detected its ip address by machine with MAC Address

    Hi
    I am getting error "Controller detected its ip address x.x.x.x using my machine with MAC address xx:xx:xx:xx:xx:xx"when i upgrade my Cisco Wireless Controller 5508 from 7.0.116.0 to 7.4.110.0. Any suggestion
    Regards

    Hi Mohammed,
    If you have more then one controller ??
    Could be:
    1.Error suggest that it hase detected a duplicate address(its managemnet IP address fo WLC) is in used by a client with the mac address xx:xx:xx:xx:xx:xx.
    Please chekc the management interface IP on each controller.
    2. Looks like u enabled LAG on controller ?
    Means you have connected more then one port from your controller to different switches.
    regards

  • Domain authentication with mac address restrictions

    I am in a branch office and I have one WLC 5508 and one ACS 4.2 with three WLANs:
    WLAN1 with SSID1: for company computers and laptops
    WLAN2 with SSID2: for ipads and tablets
    WLAN3 with SSID3:  for guests
    I am asked to configure WLAN2 as “WLAN2: Provides the Wi-Fi connectivity to ipads and tablets, with back end security using domain authentication with mac address restrictions.

    You would need to create a seperate policy and be able to have a seperation between the two policies... It's kind of hard to explain, but you would have for example:
    Policy 1:
    Wireless user on this SSID WLAN1
    AD on this AD Group (Machine)
    Policy 2:
    Wireless user on this SSID WLAN 2
    AD on this AD Group (USer)
    Thanks,
    Scott
    *****Help out other by using the rating system and marking answered questions as "Answered"*****

  • Change source mac address in real-time

    How can I send Ethernet packet with fake source Mac address, or using more than one mac address upon one physical interface (probably by using some DLPI massage)?

    HI,
    The mac address of a machine can be changed with command #ethers or ether chekup with the 1 given by u . # ether

  • Finding the MAC address?

    I need to assign fixed IPs to several computers on my mixed ethernet/wireless network. I notice that there are MANY MAC addresses on any given computer when examined by the profiler. Which profiler MAC address is the correct one to use?

    I need to assign fixed IPs to several computers on my mixed ethernet/wireless network. I notice that there are MANY MAC addresses on any given computer when examined by the profiler. Which profiler MAC address is the correct one to use?
    For devices connected by Ethernet, you would want to use the Built-in Ethernet Hardware (MAC) Address; for devices connected by AirPort, you would want to use the AirPort Hardware (MAC) Address as listed in the Systems Profiler.

  • Configuring Virtual MAC Addresses on ASA

    Hello,
    I configure the virtual MAC address for a interface on ASA 5520, will enter the following command on the active unit:
       failover mac address Inside 0012.3456.789a 0023.4567.89ab
    The active MAC address is of the same as the Inside's burned-in MAC address of the active unit.
    Similarly, the standby MAC address is of the same as the Inside's burned-in MAC address of the standby unit.
    Do I get the effect of failover mac address command?
    Thank you for your cooperation in advance.

    Hi Bro
    That’s fine really. There’s nothing wrong if you’ve configured the active MAC address the same as the Inside's burned-in MAC address of the active unit.
    In an Active/Standby failover, the MAC addresses for the primary unit are always associated with the active IP addresses. If the secondary unit boots first and becomes active, it uses the burned-in MAC address for its interfaces. When the primary unit comes online, the secondary unit obtains the MAC addresses from the primary unit. The change can disrupt network traffic.
    You can configure virtual MAC addresses for each interface to ensure that the secondary unit uses the correct MAC addresses when it is the active unit, even if it comes online before the primary unit. If you do not specify virtual MAC addresses the failover pair uses the burned-in NIC addresses as the MAC addresses.
    P/S: If you think this comment is useful, please do rate them nicely :-)

  • IP address Confilct with Mac Address

    I have a windows server domain within which I have four mac users, three of them are using the latest version of leopard and all of them are having the same problem. This has happened three times (twice since I have worked here) and I have not seen any real resolution to the problem. The error I get "IP xxx.xxx.xxx.xxx is in use by the following mac address" happens for no apparent reason. I know very well that the IP address is not in use, and whats more is that the mac address that is said to be in conflict bound to the four diffrent IP addresses is the same on all four computers. This does not make any sense, how can diffrent IP addresses be in conflict with a device that is said to use the same mac address.
    I have identified that the mac address is given to a trunk port on one of my cisco switches. I know the switch does not conflict with the IP addresses.

    is in the same path:
    /System/Library/SystemConfiguration/IPConfiguration.bundle/Resources/IPConfigura tion.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>ARPDetectCount</key>
    <integer>3</integer>
    <key>ARPDetectRetryTimeSeconds</key>
    <real>0.015</real>
    <key>ARPGratuitousCount</key>
    <integer>1</integer>
    <key>ARPProbeCount</key>
    <integer>3</integer> *YOU NEED TO CHANGE IT*
    <key>ARPRetryTimeSeconds</key>
    <real>0.4</real>
    <key>DHCPAcceptsBOOTP</key>
    <false/>
    <key>DHCPAllocateLinkLocalAtRetryCount</key>
    <integer>2</integer>
    <key>DHCPDefendIPAddressCount</key>
    <integer>3</integer>
    <key>DHCPDefendIPAddressIntervalSeconds</key>
    <integer>30</integer>
    <key>DHCPFailureConfiguresLinkLocal</key>
    <true/>
    <key>DHCPInitRebootRetryCount</key>
    <integer>2</integer>
    <key>DHCPLocalHostNameLengthMax</key>
    <integer>15</integer>
    <key>DHCPRequestedParameterList</key>
    <array>
    <integer>1</integer>
    <integer>3</integer>
    <integer>6</integer>
    <integer>15</integer>
    <integer>119</integer>
    <integer>95</integer>
    <integer>252</integer>
    <integer>44</integer>
    <integer>46</integer>
    <integer>47</integer>
    </array>
    <key>DHCPRouterARPAtRetryCount</key>
    <integer>0</integer>
    <key>DHCPSelectRetryCount</key>
    <integer>3</integer>
    <key>DHCPSuccessDeconfiguresLinkLocal</key>
    <true/>
    <key>DiscoverAndPublishRouterMACAddress</key>
    <true/>
    <key>DiscoverRouterMACAddressTimeSeconds</key>
    <integer>60</integer>
    <key>GatherTimeSeconds</key>
    <integer>1</integer>
    <key>InitialRetryTimeSeconds</key>
    <integer>1</integer>
    <key>LinkInactiveWaitTimeSeconds</key>
    <integer>4</integer>
    <key>MaximumRetryTimeSeconds</key>
    <integer>8</integer>
    <key>MustBroadcast</key>
    <false/>
    <key>RetryCount</key>
    <integer>9</integer>
    <key>RouterARPEnabled</key>
    <true/>
    <key>RouterARPExcludedSSIDs</key>
    <array>
    <string>tmobile</string>
    </array>
    <key>Verbose</key>
    <false/>
    </dict>
    </plist>
    Message was edited by: Federico_82
    Message was edited by: Federico_82
    Message was edited by: Federico_82

  • How can I get the MAC address

    My machine has two NIC's. I need to add another network interface, however when I do so it gets assigned to the same MAC address as the interface in use. Why is that and how can I determine the MAC address of the other card to be able to assign it to the new interface?
    thanks

    If necessary, change the value of local-mac-address? as follows:
    eeprom local-mac-address?=true
    When you reboot the system, the interfaces with factory-installed MAC addresses now use these factory settings, rather than the system-wide MAC address. Interfaces without factory-set MAC addresses continue to use the system-wide MAC address.
    [http://docs.sun.com/app/docs/doc/816-4554/eyprp?a=view]

Maybe you are looking for

  • Row Total in PLD

    How can I show in the Offert document the total of the row including the VAT instead the without VAT ? There is a variable 0 , if I use variable 185 this show the same. Giuseppe

  • Is there a way to do multiple indexes and ToCs?

    I have InDesign, CS2.  I am wondering, is it possible to do multiple indexes? For example, an index of names, a separate index for places. Similarly, is it possible to make multiple Tables of Contents? What I really want is a Table of Contents, a lis

  • Dreamweaver CS4 Cell border question

    Hi I am working on a site and have a small table on a page which is styled with CSS. Whatever I do I cannot remover the black borders to each individual cell. There appears to be no border to the table, just each cell. The page can be viewed here: <h

  • Best practices on using OLM for sign-off on compliance policies?

    We are working on a project to build a parent/child learning object that will include four compliance policies and a "test" to sign off acceptance of these policies as a condition of employment. Has anyone implemented something like this? If so - can

  • CS4 design premium student licensing, surface pro 2

    back in 2009 i bought cs4 design premium package(windows) for school. two years later my computer was badly damaged and was wiped clean of all software and never used again. i now have bought the surface pro 2 and was planning on dowloading my cs4 fo