Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Mobile IE11 issues with Form validation using RegEx

edited November 2013 in Miscellaneous

Since the issue page isn't working for me, I'm posting my problem here. I've used RegEx expressions to validate form values. It works on all browsers on all platforms except one. I can't figure out if it's the framework or the browser itself causing the problem so here it is. Mobile IE11 throws the "notice" message every time the user submits the form. The funny thing is, using Desktop IE11's Windows Phone emulator it doesn't happen and the form validation works flawlessly.

Comments

  • What are your validation rules? It automatically mirrors the validation on the client as well as the server, so there's a chance the regex isn't getting converted correctly.

  • here you go: /^[0-9]{1,}$/

    checks if value are all numbers. it's for a phone input.

  • I'm still downloading the IE11 virtual machines from modern.ie, but I tested across the other browsers and it does seem like it should be fine. Here's my test code:

    apps/test/handlers/reg.php

    <?php
    
    $form = new Form ('post', $this);
    
    echo $form->handle (function ($form) {
        info ($_POST);
    });
    
    ?>
    

    apps/test/forms/reg.php

    ; <?php /*
    
    [phone]
    
    regex = "/^[0-9]{1,}$/"
    
    ; */ ?>
    

    apps/test/views/reg.html

    <form method="post" id="{{_form}}">
    
    <input type="phone" name="phone" id="phone" />
    <span id="phone-notice" class="notice">Invalid phone #</span>
    
    <button>Submit</button>
    </form>
    

    I should be able to test in IE11 tomorrow, but let me know if you spot anything off in my test.

  • Just got it running in IE11, my test seems to be working. Let me know if you can fix your site based on the above. Cheers!

  • Fixed it. My bad. Wrong regex.

Sign In or Register to comment.