Software Archive
Read-only legacy content
17060 Discussions

App Preview Submit()

Alex3
Beginner
623 Views

Hey I am here again with something very weird.

I have this code

        <form id="loginuser" method="post" action="">
        <div class="main" data-role="content" class="ui-content">
            <div class="row">
                <div class="column">
                    <div class="form-group">
                        <label for="bii-login-email"><span>Email login</span></label>
                        <span class="form-element-wrap"><input id="email" name="email" type="text" placeholder="email" value="tello@biipit.com"/></span>
                    </div>
                    <div class="form-group">
                        <label for="bii-login-password"><span>Password</span></label>
                        <span class="form-element-wrap"><input id="pass" name="pass" type="password"
                                                               placeholder="password" value="123456"/></span>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="column small-10 small-offset-1 login-set">
                    <p class="button-login"><a href="javascript:$('form#loginuser').submit();">Login</a></p>

                    <p><a href="javascript:">Forgot Password</a></p>

                    <p><a href="javascript:">Facebook Login</a></p>

                    <p><a href="javascript:">Create New Account</a></p>
                </div>
            </div>
        </div>
        </form>

When I clicked on Login, the app restart... notice that this works on Emulator but not in App Preview

Thanks in advance.

0 Kudos
2 Replies
Alex3
Beginner
623 Views

By the way I added an id to the anchor

<a id="login_action">Login</a>

and found this code on Jquery Mobile page but doesn't work, when I tap on Login anchor nothing happens

    jQuery( "#login_action" ).on( "tap", function() {
        alert('login');
        $.mobile.loading('show');
        var form = document.getElementById('loginuser');
        //alert(form.email.value + '-' + form.pass.value);
        intel.xdk.device.getRemoteData(rest_url + "mobile/login/", "POST", "&email="+form.email.value+"&pass="+form.pass.value, "success_login", "error");
        //return false;
    });

Please help ASAP because is very weird, remember that in Emulator works but in App Preview is the problem. 

0 Kudos
Alex3
Beginner
623 Views

Well I saw that no body help me with this issue, but I continuous working finding a solution and now I detected that the problem is when I try to submit a form, every time that I try to submit a form, the app preview is restarted, a gain in Emulator works perfectly.

I hope that some body help me because my head goes to blow out with this App Preview

Thanks.

0 Kudos
Reply