Software Archive
Read-only legacy content
17061 Discussions

How to create a contact form?

ben4
Beginner
253 Views

Hello,

I would like to know how forms work on intel sdk using bootstrap please.

It is my understanding that a form cannot be sent if there are no email servers, do android phones run email servers?

If I wanted to create a form now, where shall I start please, any examples are welcome.

 

Thank you,

 

Ben

0 Kudos
3 Replies
Chris_P_Intel
Employee
253 Views

There are two approaches you could pursue. Both require a bit of programming.

In one approach you have the phone send the email. This will require a Cordova plugin. I believe there is at least one, perhaps more.  Here is one: https://github.com/katzer/cordova-plugin-email-composer

 

In the second approach, you have your own server someplace and the form simply POSTs the data to your server, and it then sends the email.  You will need a web server setup (or web service) and code to receive the submitted data, verify it, and then send.  This approach is a bit trickier because you have the security concern. If anyone finds out you have a webserver that sends mail, they will undoubtedly try to figure out how to use it send spam.

Hope this helps,

Chris

0 Kudos
ben4
Beginner
253 Views

Hi Chris,

 

Thank you for the explanations.

What about having the website form iframed in a page? would this be ok?

I installed the InAppBrowser

 

I tried to do it using this code at the top of the index.html file

    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    //
    function onDeviceReady() {
         var ref = window.open('https://kollox.com', '_blank', 'location=yes');
         ref.addEventListener('loadstart', function(event) { alert('start: ' + event.url); });
         ref.addEventListener('loadstop', function(event) { alert('stop: ' + event.url); });
         ref.addEventListener('loaderror', function(event) { alert('error: ' + event.message); });
         ref.addEventListener('exit', function(event) { alert(event.type); });
    }

    </script>

But there are 3 problems:

1)When the app loads, the whole app loads with the frame, any design I have created using the sdk designer is not showing anmore, only the iframe website shows up.

2)I keep getting an alert box each time a page loads from that website, could it be because it is https?

3)How to warn the user that he needs to be connected to the internet in order to access this page?

 

Thank you,

 

Ben

0 Kudos
PaulF_IntelCorp
Employee
253 Views

Anything you put inside an iframe is no longer part of your app. An iframe is, fundamentally, a mechanism for containing another page, sort of like a convenient way to show a window to another location. Beyond that, they are hard to use and not very useful, especially in the context of a mobile app. If all you are trying to do is turn a web site into an app, I suggest you try using the inAppBrowser plugin.

0 Kudos
Reply