Is it possible to access/display a cancel button on a mobile keyboard? - forms

I'm hoping to remove some buttons from the UI in the mobile version of my Vue-built SPA.
If I include a form element in my app, the return button on a mobile keyboard allows the form to be submitted, and thus trigger all of the related listeners that close the form, update the data, etc.
Is there a way to access a cancel button for forms on mobile keyboards?

There is no way of triggering a forms "reset" button via a mobile keyboard.
Cheers

Related

Hardware Button Clicks

Please is there a way to register home button click events that will trigger a reaction to send a text message to someone in flutter? If not, is there a way to natively add a plugin to the flutter project?

How can I detect focus in textfields in a webview using Swift 3?

I am building an application, and when I load a website in webview using Swift 3, the screen will appear like this, now I want to detect when user clicks on the email text field, and add a button to the navigation controller.
I don't know how to do it, does anyone have any idea?
The main use of webview is near like an iframe in web.
I mean that webview is just a displaying of internet content. By this way, you cannot detect any action like user clicks on email textfield.
According to me and currently, there is no possibility to do that because it is not the goal of a webview.

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..

Facebook-like button as an overlay to have cross-network liking?

I have a page that allows users to "like" certain elements. The liking is similar to a facebook-like, but for various reasons (such as being able to easily manipulate the data), the liking is for users of my site, and not necessarily for facebook users, and the data remains on my site. So there is a "mysite-like" button. However, I'd like it if this mysite-like button also functioned as a facebook-like button, and if a person is logged onto facebook, it would post it on their wall.
Is there a way to make a button which performs both functions? E.g. perhaps by having an invisible facebook-like button, overlayed on top of the mysite-like button? Perhaps through some opacity=0 iframe? In an ideal world, clicking on one button would function as a mysite-like, and also a facebook-like, and a google+1. One button to rule them all...
The clean way to do this kind of implementation, where user interaction on a social button triggers changes on your site, is to use the callback methods.
Limitation
These callbacks work in one direction. For example:
Facebook Like button -> your custom 'like' button
OR
Google +1 button -> your custom 'like' button
As a result you will not be able to
trigger either of them from your custom 'like' button
trigger one third party button from the other
And now that you know what you can do with them, here's how to do it.
Facebook Like button callback (from another StackOverflow post)
<script>
FB.Event.subscribe('edge.create', function(href, widget) {
alert('You just liked the page!');
// this is where you would trigger your site specific logic
});
</script>
Google +1 button callback (from the official docs)
<g:plusone callback="myCallback"></g:plusone>
<script>
function myCallback(result) {
alert('button was just changed to state ' + result['state']);
// this is where you would trigger your site specific logic
}
</script>
One way is to have the facebook-like button also trigger a "mysite-like" action e.g. via http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/
Is there a way to do this also with google+? You can use the callback option https://developers.google.com/+/plugins/+1button/#plusonetag-parameters but not sure how to get the userid of the user.

fill UIWebVIew TextInput with custom keyboard

For an app I am working on I want a custom keyboard to come up when you tap on an input field in a UIWebview, for example for UITextView i use this code :
myText.text = [myText.text stringByAppendingString:#"a"];
but i don't know how can i fill a text field in UIWebVIew
Any help would be very much appreciated; thanks!
I don't think it's possible to use a custom keyboard for a text field within a UIWebView.
There is bidirectional communication with the UIWebView, but it is a little convoluted.
You can use stringByEvaluatingJavaScriptFromString to execute any javascript in the context of the web page. That can be used to send data to the web page, modify forms, or poll for data and events.
You can use webView:shouldStartLoadWithRequest:navigationType: to receive notifications from the web view. Define a custom scheme like myapp: and handle all such requests returning NO from shouldStart. You can use ajax style calls to trigger the notifications, although the actual ajax call will always fail because you are returning NO.
If you want to have a custom keyboard show up, you must send a notification to the host application via your custom scheme, display a UITextView over the web view, then send the results back via javascript.
At least, that is the documented way to do it.
Check dcorbatta's answer in this article Custom Keyboard in UIWebView
He suggest to use a UITextField as a "media" when you detect keyboard coming up inside a UIWebView. Thus, you can use whatever Keyboard type you want on the UITextField. After users taps something, copy the text in UITextField the media via JavaScript ActiveDocument.
I spent too much time investigating that.
Blur the text inputs using JavaScript or jQuery.
Use on screen keyboard like any UIjquery plugin
Now you have to take a look at this nice keyboard and learn how to integrate it into you web pages.
http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-keyboard-with-css-and-jquery/
One limitation.
It works only for your pages unless you hijack the page when it is done loading and attaché your keyboard and blur all text inputs when they get highlighted or focused.