Form ng-submit ionic app mobile doesn't submit on mobile - android

Hello everyone i have been working alot on my app and added form validation with angularjs. so i used this form ng submit to trigger a function if my inputs and variables contains what they should be.
below is the sample of my login form html
<form ng-submit="login_form.$valid && login()" name="login_form">
<li align="center">
<img src="img/xiroos-logo.png" alt="Xiroos Logo">
</li>
<li>
<div class="form-group">
<sup>Email</sup>
<input type="text" name="userName" ng-model="userName" class="input-text form-control input-lg" ng-class="((login_form.userName.$valid)?'valid':'invalid')" ng-required="true" placeholder="sample#email.com" />
</div>
</li>
<li>
<div class="form-group">
<sup>Password</sup>
<input type="password" name="password" ng-model="password" class="input-text form-control input-lg" ng-class="((login_form.password.$valid)?'valid':'invalid')" ng-required="true" placeholder="• • • • • • • •" />
</div>
</li>
<li>
<xr-loading status='loading'></xr-loading>
<input type="submit" ng-init="btnText='Login'" ng-click="!login_form.$valid && xrAlert({'title':'Oops!','body':'Fill all required fileds.'})" class="btn btn-block btn-round btn-orange shadow" ng-value="btnText" />
</li>
<li align="center">
<p><small><a ui-sref="forgot_password">Forgot your password?</a></small></p>
</li>
</form>
If i try to login without putting anything in my inputs. i will get a popup modal to fill up required fields. I'm testing my app in my browser of course. then when i tried to parse my app to mobile app. and i tried on my android.
It seems it doesn't trigger my form submit and also it doesn't show my popup modal on ng-click of my login button

Oopps. problem solved, the parsing of my apk maybe got some problem, and i tried to parse it again using cordova and now it works.

Related

laravel 5.4 chrome for android not showing validation errors

I have a website working perfectly on desktop, however, google chrome is not showing validation error messages or flash info.
I tried other navigators like html source code viewer: worked perfectly
on chrome for desktop, everything is ok
when I serve my project from my computer and access it throgh wifi, it works perfectly
My server is running nginx on linux debian
The problem is, this only happens on my signin/signup page, other pages are showing errors and flash messages perfectly even on chrome for android
here is my view:
<h3>Welcome back</h3>
<div class="row">
<div class="col-lg-6">
<form class="form-vertical" role="form" method="post" action="{{ route('auth.signin') }}">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="control-label" id="email">Email</label>
<input type="text" name="email" class="form-control" id="email">
#if ($errors->has('email'))
<span class="help-block">{{ $errors->first('email') }}</span>
#endif
</div>
<div class="form-group{{ $errors->has('password') ? ' has- error' : '' }}">
<label for="password" class="control- label">Password</label>
<input type="password" name="password" class="form- control" id="password">
#if ($errors->has('password'))
<span class="help-block">{{ $errors- >first('password') }}</span>
#endif
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="remember"> Remember me
</label>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Sign in</button>
<a style="padding-left: 10px;" href="{{ route('auth.forgot') }}">Frogot your password?</a>
</div>
<input type="hidden" name="_token" value="{{ Session::token() }}">
</form>
</div>
</div>
<script>
(please don't mind the spaces in the code, I don't have these in my page)
inside my controller, I have this:
$this->validate($request, [
'email' => 'required',
'password' => 'required',
]);
and I show flash messages this way:
return redirect()->back()->with('info', 'Incorrect sign in information.');
can you please help me out? this is really weird and frustrating
thank you
Haser!
I have the same problem on the test server, but the production is ok.
Having studied all the circumstances, I am inclined to believe that in my case the problem lies in the absence of https on the test server.
My logic is this: mobile chrome sees the password entry field and sees that there is no certificate. These two circumstances come to non-standard behavior. Indirectly, I managed to confirm my theory by studying the password change page, there is the same situation with the absence of errors.
This behavior is observed only in mobile chrome on android!

Cannot use click() in Selenium with mobile emulated chromedriver

I'm trying to test the login process of an internal web application using a mobile emulated chrome browser. I am using Python 3.6.4.
It finds the element by name, but won't click it!
Here is my code:
from selenium import webdriver
enter code herefrom selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
import time
mobile_emulation = {
"deviceMetrics": { "width": 360, "height": 640, "pixelRatio": 3.0 },
"userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" }
chrome_options = Options()
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)
driver = webdriver.Chrome(chrome_options = chrome_options)
driver.get("https://internalweburlhere")
elem = driver.find_element_by_id("txtEmailAddress")
elem.clear()
elem.send_keys("Username")
elem = driver.find_element_by_id("txtPassword")
elem.send_keys("1234")
print("Password Entered")
driver.find_element_by_id("btnSignIn").click()
print("Logged In")
Here is the website source:
<div id="divSignIn" class="login-content-sign-in" style="display:block;">
<div id="divSignInHeader" class="login-content-header text-bold-10 label-colour" MandatoryField="False">Sign in using your Portal account</div>
<div id="divSignInMessage" class="login-content-sign-in-message success-label-colour text-bold-9" MandatoryField="False" style="DISPLAY:none;">Your account email address has now been verified, please enter your password and sign in</div>
<div id="upSignIn">
<div id="divSignInEmailAddress">
<div id="lblEmailAddress" class="entry-label">Enter your email address</div>
<div>
<input name="txtEmailAddress" type="email" id="txtEmailAddress" aria-autocomplete="none" autocomplete="off" maxlength="50" class="login-content-email-address entry-control entry-control-colour entry-control-border text-9" onkeyup="checkSignInButton()" />
</div>
</div>
<div id="divPassword">
<div id="lblPassword" class="entry-label" MandatoryField="False">Enter your password</div>
<div>
<input name="txtPassword" type="password" id="txtPassword" aria-autocomplete="none" autocomplete="off" class="login-content-password entry-control entry-control-colour entry-control-border text-9" onkeypress="checkCapsLockStatus(event,'divSignInCapsLock')" onblur="hideCapsLockStatus('divSignInCapsLock')" onkeyup="checkSignInButton()" />
<div id="divSignInCapsLock" class="login-caps-lock-status">
<div id="divCapsLockDetail">
<img src="/Portal_Benchmark/Static/5.8.0.192/Images/dlg_icon_Exclamation.png" class="login-caps-lock-image" />
<span id="lblCapsLockMessage" class="login-caps-lock-message text-8" MandatoryField="False">Caps Lock Is On</span>
</div>
</div>
</div>
</div>
<div id="divSignInCaptcha" class="login-content-sign-in-captcha">
<div id="lblSignInCaptcha" class="entry-label">Enter the captcha text shown below </div>
<input type="hidden" id="objSignInCaptcha_clientState" name="objSignInCaptcha_clientState" /><div id="objSignInCaptcha" class="ig_Control igc_Control"><div class="igc_CaptchaImageArea"><img src="WebCaptchaImage.axd?guid=588a4174-70ca-4bf6-ac10-7ac77f74e6a4" title="" alt="" height="60" width="175" class="igc_CaptchaImage" /><input type="hidden" id="objSignInCaptcha__SignInEditor_clientState" name="objSignInCaptcha__SignInEditor_clientState" /><input title="{0}" id="objSignInCaptcha__SignInEditor" aria-autocomplete="none" autocomplete="off" onkeyup="checkSignInButton()" readonly="readonly" name="objSignInCaptcha__SignInEditor" maxlength="8" class="igc_CaptchaInput igte_Edit" type="text" style="width:175px;text-align:notset;" /></div><div class="igc_RefreshAndAudioButtonsArea"><img alt="Listen to Captcha Audio" id="x:1812979435.0:mkr:AudioButton" src="Static/5.8.0.192/PortalStyleSheets/Infragistics/Default/images/igc_AudioButton.gif" /><a id="x:1812979435.1:mkr:RefreshButtonLink" href="#"><img alt="Refresh Captcha Image" id="x:1812979435.2:mkr:RefreshButton" src="Static/5.8.0.192/PortalStyleSheets/Infragistics/Default/images/igc_RefreshButton.gif" /></a></div><div style="clear:left;"></div></div>
</div>
<div class="login-content-sign-in-panel">
<div id="lblError" class="login-content-sign-in-error warning-label-colour text-bold-9">
</div>
<div class="login-content-sign-in-button">
<input name="btnSignIn" type="submit" id="btnSignIn" disabled="disabled" value="Sign In" />
</div>
</div>
</div>
Can anybody suggest how I might get around this? Interestingly, when I run similar code at BrowserStack on an android chrome browser, the clicks work as intended. Just not when I run it locally.
Some time element present in DOM but selenium failed to wait until the attribute get removed . Possible guess is In your case it is not waiting for remove attribute disabled="disabled" from your input tag and performing the click, even you can't see any exception.
So in such case you have to inject javascript in your browser and perform the action as given below :
element = driver.find_element_by_id("btnSignIn")
driver.execute_script('arguments[0].click();', element)

Phonegap: How to show configuration screen only once

I have started work on Phonegap and it is very hard for Native App developer to go for Hybrid.
Just want to know that how I can show configuration screen only once in Phonegap. Below is the screenshot. I just want to show it only when user runs an app first time, and not again and again whenever user launches an app and saves IP address.
The problem here is that, whenever I press back button of device, this screen gets display.
Here is my HTML:
<body>
<div data-role="page" id="pageConfig"> // This Div needs to show only first time
<div class="ui-content" data-role="main">
<h3>Configurations</h3>
<label for="ipText">IP Address:</label>
<input type="url" id="ipText" name="ipText" />
Save
</div>
</div>
<div data-role="page" id="pgLgn">
<div data-role="main" class="ui-content">
<form id="form1" class="validate">
<div class="ui-field-contain">
<label for="usrNme">Username:</label>
<input type="text" name="usrNme" id="usrNme" placeholder="Username" data-clear-btn="true" data-theme="d" class="required" />
</div>
<div class="ui-field-contain">
<label for="pswrd">Password:</label>
<input type="password" name="pswrd" id="pswrd" placeholder="Password" data-clear-btn="true" data-theme="d" class="required" />
</div>
<div class="ui-field-contain">
<input type="checkbox" id="chbx-0" class="custom" data-inline="true" />
<label for="chbx-0">Remember me</label>
</div>
<input type="submit" data-inline="true" value="Login" id="btnLogin" data-shadow="false" data-theme="a" onclick="OnLoginClick()"/>
<input type="reset" data-inline="true" value="Reset" data-shadow="false" />
</form>
</div>
</div>
</body>
What Cordova Plugin I need?
NOTE: I am using Jquery Mobile and Cordova SQLite Plugin for data storage. And my app is Single Page Architecture.
Thanks in Advance!
Please let me know if not clear.
You have to write this line in device ready function.
document.addEventListener("backbutton",onBackKeyDown,false);
function onBackKeyDown(){
if($.mobile.activePage.attr("id") == "pgLgn"){
navigator.app.exitApp();
}
else{
navigator.app.backHistory();
}
}
Use localStorage. Save a simple string with key and check whether there is a particular value against key or not in deviceready function.

Strange symbol appearing in HTML on android - phonegap app

I'm creating a mobile app with backbone, phonegap and for css topcoat (http://topcoat.io/).
I have a strange problem when viewing the app on my android phone. Im using android version 2.3.3. A mail symbol on it's side appears, seemingly whereever p and span tags are used.
Here is the code (in this case it goes into the else):
<ul class="topcoat-list list">
<% _.each(players, function(player) { %>
<li class="topcoat-list__item">
<%
if(checkbox){
%>
<label class="topcoat-radio-button">
<input type="radio" name='player_id' value="<%= player.id %>" />
<div class="topcoat-radio-button__checkmark"></div>
<div class="player-details">
<span><%= player.name %></span>
<span><%= player.position %></span>
</div>
</label>
<%
}
else{
%>
<div class="player-details">
<span><%= player.name %></span>
<span><%= player.position %></span>
</div>
<%
}
%>
<div class="player-more">
<a target="_blank" href="http://www.premierleague.com/<%= player.link %>">More</a>
</div>
</li>
<% }); %>
</ul>
I have gone through topcoat.io css but it doesn't set any css for span or p tags...Any ideas what could be producing this weird symbol?
This is an encode issues. Where is the code that generates this HTML. It could be the linebreak code causing it. Remove the line break.
<li class="topcoat-list__item">
<div class="player-details">
<span>Tim Krul</span><span>Goalkeeper</span>
</div>
<div class="player-more">
<a target="_blank" href="http://www.premierleague.com//en-gb/players/profile.overview.html/tim-krul">More</a>
</div>
</li>

bootstrap 3.0 on android phonegap

is there any known issue of bootstrap 3.0 (the latest one) on android phonegap. I am able to see the buttons nicely on firefox (and on same resolution as on phone) but when the binary is installed on the phone the buttons do not render....
is this a known issue ?
Following is my simple template:
<div id="mcontent">
<div id="swrapper">
<div id="islider">
<div class="btn-group btn-group-justified">
<a class="btn btn-default" href="#">Mrs</a>
<a class="btn btn-default" href="#">Ms.</a>
<a class="btn btn-default" href="#">Mr.</a>
</div>
<form>
<input type="text" name="firstname" placeholder="Firstname">
<input type="text" name="lastname" placeholder="Last Name">
<p><input type="text" name="email" placeholder="Email"></p>
<p>Must be at least 8 characters long</p>
<input type="password" placeholder="Password">
<input type="password" placeholder="Password repeat">
<p><button type="submit" class="btn btn-primary btn-large btn- block">Submit</button></p>
<p><span id="dclaimer">By registering you confirm that you accept our Terms of Use and Privacy Policy</span></p>
</form>
</div>
</div>
</div>
I know this is an old post but I have had the same issue. I believe this is down to jquery mobile. As when i removed it, it worked
Removing just the css of jquery mobile seems to keep jquery mobile functionality and allow bs to work

Categories

Resources