how can I disable bootstrap modal on desktop and enable only for mobile/tablets? - modal-dialog

enter image description here
We have two user interface, one for desktop and one for mobile, when user gonna login via desktop, then the username input and username password fields will show, and when it turns into mobile view, then both fields will be hidden and the screen shows look like below;
enter image description here
the issue is this, when I try to log in and click on login button, the login will appear ok, but when I click on login via desktop, the modal will appear too, I want to move or display hidden login popup on desktop screen. please answer.

You can handle click event on the button and check whether are input fields visible or not. If not, then show modal programmatically by calling $("#modal").modal('show')
So as default, use your login form as regular form (dont use bootstrap modal) and in JS:
$("#submitbutton").click(function() { //catch button click
if ( !$("#username").is(":visible") ) { //is mobile version?
event.preventDefault(); //dont send form
$("#modal").modal('show'); //but instead, show modal
}
});

Related

How to exit app with back button instead of just pop

I am building an app(Learning) and on first use the app it show authentication page with login and signup button if user click any one button and fill the fields it will be navigate to homePage.
Navigation :
Authentication Page=>login=>main page
Now the problem is I don't want users to get back to login page if they press back button on home page. Instead I want to exit the app.
How can I do it?
When you navigate from login to main page use Navigator method .pushReplacement() instead of .push() and that will replace the login page on Navigator stack. Which means that the main page will be the only one on the stack. Pressing the back button or calling method .pop(), in that case, will close the application.

How to choose radiobutton in popup

In my application , I have to choose radio button value (yes or no) after I click on some button in the popup. when I click on the button , user will be navigated to home page of the application, where the user will be displayed with some message in the popup with yes or no value.I have tried the below code " WebElement radioBtn = driver.findElement(By.id("notifyConfirm"));
radioBtn.click(); "..but since the user is navigate from the child page to parent page, I am not able to click on the value in the popup using id....when I execute the script I am getting below error...."Element is not currently visible and so may not be interacted with

Mobile Safari submit with enter key

I am using an iPad with a bluetooth keyboard and am having some troubles. I basically have a website that after tapping search, pops up with a modal. The modal contains a summary of information & two buttons - a cancel and a print. My hope is to have the "Enter" key mean the user clicked on the "Print" button. I've tried going the javascript route with click triggers and such, and I've also tried making it into a form with a submit button but mobile safari likes neither. It seems like it requires that I touch the screen again before pressing enter to work. Any ideas would be greatly appreciated..

How to remove submit button from a dialog opened for a web-item?

The dialog opened for the web-item has a submit button and a cancel link in it.
I don't want the submit button to be present in the dialog.
How to do that?
The api provided by connect i.e.
AP.require('dialog', function(dialog){
var submitButton = dialog.getButton("submit");
submitButton.disable();
});
has methods only to enable/disable it.
You can turn the chrome of the dialog off when it's created via dialog options. You would need to add your own buttons in once this has been done.

Facebook like button on Apache Cordova/Phonegap app

I have inserted a facebook like button with this methods like a simple web:
https://developers.facebook.com/docs/plugins/like-button
But the first time that a button is pressed a login window opens. This window opens in the current window, not in a new window. After the user logs in the window try to close itself but it can't. A white window is showed.
Next times the like button works correctly because the user is logged in.
I also try to implement with the cordova plugin "phonegap-facebook-plugin" but it doesn't have support for like button.
https://github.com/phonegap/phonegap-facebook-plugin
I think you need to listen to when they've finished logging in and redirect back to you're application some like this.
Only with window.location set to something like file:///android_asset/www/index.html or whatever page you want to return the user to.
<fb:login-button onlogin="document.location.href='file:///android_asset/www/index.html';">
</fb:login-button>
Something like this but for the like button ?