Does anyone know if there are any (near) future plans to enable getUserMedia for Safari on iOS?
Secondarily, does anyone know of any work-arounds to access the camera from a standard mobile website on an iPhone? I saw a post that referenced:
<input type="file" accept="image/*" capture="camera">
Can anyone confirm that this really works, and would I use this in lieu of getUserMedia, or would I do a browser/device detect first to determine if I should go the getUserMedia v. capture="camera" route?
Well, I'm not sure what you want, but I saw this javascript code that works, I mean it takes the picture.
<script>
$("#image-picker").change( function (event) {
var files = event.target.files;
if (files.length>0) {
}
});
/script>
<input id="image-picker" type="file" accept="image/*" />
If you want to save, you got me there, I still don't know how to save the picture you take. Hope this helps you.
Related
i have been strugling a bit with getting this to work, as i prefer not to use the PayPal plugin since it look like much work for the simple thing im trying to achieve.
I have basically followed the PayPal guide to create a donate button which works in a browser, but when i click it inside a ionic project it wont work and i cant get it to open.
I have tried with just the form (which doesnt open the browser with the callback):
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_system"> [...] </form>
After that i tried to first open a window and then do the post in that window, but that just closed the window at once.
$scope.donate = function() {
var win = window.open( "about:blank", "_blank" );
document.getElementById('theForm').submit();
}
I dont really know what can be done from here so any help would be appreciated.
Edit:
On a sidenote, is it possible to use https://www.paypal.com/no/webapps/mpp/send-money-online and then add for example a default receiver email like sendt#me.com somehow?
I have a same problem and I solved it, with "ngNoForm". ngNoForm turn off ngSubmit behavior (which prevent default submit on form).
So the code is:
<form ngNoForm action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_system"> [...] </form>
I am creating an html5 app that uses x-webkit-speech.
For those not familiar with x-webkit-speech, it is added to regular inputs like this, <input type="text" x-webkit-speech />, and then gives the user the ability to use their voice instead of their keyboard.
I was wondering how to submit a form when you are done speaking. Google does it on their homepage, so I know it is possible, I just have no idea how to do it.
Thanks,
Ian
Looking at this webkit demo by stoyan stefanov, the event you're looking for is onwebkitspeechchange
I've been playing around with Play framework for a few days, and it seems really cool. However, I ran into some problems when I wanted to have a form on a page, post the form and show the results on the same page (with the form still on the page). Does anybody know if this is possible with Play, and if so: how?
EDIT:
I should have explained better. The form is a search-style form not a save-style form. I want to be able to search for something, have the results come up under the form and still have the values the user filled in in the form (as it is if you type in something that don't validate. I have tried to set values on the params object directly in the search action, but it disappears when the search action calls the new action.
Second try of an answer untested, hope this fits to your problem.
public static void search(String criteria1, String criteria2) {
....
params.flash();
}
search.gsp
<p id="criteria1-field">
<label for="criteria1">&{'criteria1'}</label>
<input type="text" name="criteria1" id="criteria1" value="${flash.criteria1}" />
</p>
<p id="criteria2-field">
<label for="criteria2">&{'criteria2'}</label>
<input type="text" name="criteria2" id="criteria2" value="${flash.criteria2}" />
</p>
Well this is quite simple. You put into the routes.conf a
GET /myPageWithForm MyController.read
POST /myPageWithForm MyController.save
In read you read the data and render your page with the form. In save you save the data and redirect to read via read();
Hope this answers your question.
I'm trying to do a submit via ajax of a form that contains a file element.
<form id="classic_upload" enctype="multipart/form-data>
<input type="file" name="file" id="file"/>
<br/>
<!-- ...other inputs...-->
<button type="button" id="classic_save"> Send </button>
</form>
What I need to do is to submit this form and check if the file fulfills some requirements, so I wrote an ajax submit for this form
$('#classic_save').click(function(){
$.ajax({
type:"POST",
url:'<g:createLink action="classicUploadFile" controller="scan"/>',
success: function(msg){
alert("Data Loaded: " + msg);
}
});
});
However, I have no idea how to send the file through ajax.
Some context
Originally we were using swfUpload for this. However, we ran into some trouble with https and some certificate issues. So we decided to implement a basic html fallback. Plugins are nice, but we need to guarantee that this fall back is bullet proof (thinking of google mail "classic upload").
Any thoughts? Are iframes the way to go (read somewhere google mail uses them for their classic upload)
Thanks in advance.
If you like, there is jQuery Uploadify plugin to do exactly what you are looking for other than other great features.
I use the jQuery AJAX form plugin on my site to upload files.
Here you'll find a really good example/tutorial how to upload one file http://www.phpletter.com/Demo/AjaxFileUpload-Demo/
Hope it works for you.
Cheers
Does anybody know of a simple jQuery form processing tutorial that actually works?
I have a form I want to process via jQuery/Ajax nothing difficult in PHP but in jQuery and AJAX can I get it to work - no, all the tutorials are based round sending e-mails (or just lists of more lists of more lists of tutorials - hate those)
All I want to do is learn how to send a form via jQuery and AJAX to another page, save the data in a DB without having to leave the first page. I have tried all sorts but nothing works properly. Here is my form:
<form id="form">
<input type="text" name="abc" />
<input type="text" name="def"/>
<input type="text" name="ghi"/>
<input type="submit" name="try" id="try" />
</form>
Now what do I actually do? Sounds silly I know (and I guess I'll get another -1 star for this question) but I will be honest a GOOD simple tutorial would be really useful not just to me but to the others. I know php but jQuery/Ajax - just don't know/understand. I will not be alone
This is one of the good tutorials on how to submit forms using ajax and php.
This link is a reference teaching how to submit forms via jQuery/AJAX. Have the form post to a PHP page to handle the form data.
In short, your jQuery code would look similar to this:
$("#form").submit( function()
{
// Handle validation or any extra data here.
// Return true if validation passed and the data should be posted
// Return false if the form should not be submitted
// You can also do any extra work here that you like before returning,
// including changing something on the page or showing the user a message.
}
There's a cracking plugin for this:
http://plugins.jquery.com/project/form/
It's as easy as:
$('#myForm').ajaxForm(function() {
alert("Thank you for your comment!");
});