Announcement

Collapse
No announcement yet.

Detect device - Mobile, iPhone/Cellphone?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Detect device - Mobile, iPhone/Cellphone?

    I had a customer with an iPhonee 10 tell me that he could not get past the pattern matching on OCST which required dashes in the telephone number.
    Code:
    <input type="tel" title=" must exactly match the pattern 123-456-7890 with 10 digits, dashes and no spaces [X]" placeholder="ex: 123-456-7890" name="ShipPhone" id="l-ShipPhone" value="&mvte:global:ShipPhone;" class="input" required autocomplete="new-shiphone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}">
    is there an easy way to test for mobile device so I can serve the input statement without pattern matches for mobile devices including the iPhone10?

    #2
    If you're going to enforce a pattern for a numeric input, I would recommend going withing something like this as a starting point:
    Code:
    <input type="text" inputmode="numeric" title=" must exactly match the pattern 123-456-7890 with 10 digits, dashes and no spaces [X]" placeholder="ex: 123-456-7890" name="ShipPhone" id="l-ShipPhone" value="&mvte:global:ShipPhone;" class="input" required autocomplete="new-shiphone" pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}">
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Thanks Matt. I will make that change and see if I can get someone with an iPhone to test.

      Comment


        #4
        i hate when web sites make me "enter a pattern". Shouldn't the field just except what I enter?
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          We've had a fair amount of people leaving one digit off or adding extra digits to the phone number. Then if we have to to verify something we send an email and wait until they get back to us. Sometimes it is time sensitive - workers waiting for paint for example and we can't mix it because something in their order doesn't make sense. While we eventually get a response we are down to only 3 of us here on most days - or two of us when the owner is traveling to train customers on new products - it puts a kink in the works; so the owner asked that I do something to format the phone and make sure we got 10 numbers. If I was a programmer I'd write something to check the form but this is all I could do fast with my current brain power and work load. :/

          Comment

          Working...
          X