Need help with Javascript plugin creation

  • Hi all. My question is simply this: Can I make an IOS-compatible plugin that includes an input form where users can enter text and then submit it onwards? Help is much appreciated :) I'm managing to write a plugin which displays something on the canvas but haven't had success with input forms.

    Is this possible to implement?

    Thanks.

  • You could create a form outside of krpano in the html, set display to none with css. Then in the javascript plugin you could do something like:

    var the_form = document.getElementById("yourformid");
    plugin.sprite.appendChild(the_form);

    Thats the easiest way. The other way would be creating the whole form in javascript...

    var the_form = document.createElement('form');
    the_form.id = "the_form";
    the_form.action = "post.php";
    var the_input = document.createElement('input');
    the_form.appendChild(the_input);

    not 100% sure about the syntax, but something like that.

    Edited once, last by Zephyr (November 7, 2011 at 11:40 AM).

  • OK. You may call me stupid but how am I adding stuff to plugin.sprite .......little hint please? :) First time trying to make something for the iDevices...been working with Flash for too long :)

  • So I finally managed to add a form to the js-plugin but but...in pc-browser (in iPad mode) the form works except I can't input any text to a textfield? And with a real iPhone I can enter text to it but can't make a checkbox selection nor click submit (which I can do on desktop)...

    Are these bugs or what?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!