Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2971] Create textfield in html file using titanium api

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2012-07-26T13:25:24.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
Reporterdavidlee
AssigneeNeeraj Gupta
Created2011-04-15T03:33:56.000+0000
Updated2012-07-26T21:32:20.000+0000

Description

I would like to create textboxes using titanium api in a html document. Is it possible? I have tried but boxes dint seems to display. May I know how it can be displayed? I am new to titanium. Thanks

Plat:Android; Sdk:1.5

Login.html

<!DOCTYPE HTML>
<html>
  <head>

&lt;link rel=&quot;stylesheet&quot; href=&quot;css/pub.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot; src=&quot;script/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
    var et;
    var pass;
    function initialize(){
        et  = Titanium.UI.createTextField({
            id:'email',
            backgroundColor:'#eeeeee',
            returnKeyType:Titanium.UI.RETURNKEY_DONE,
            enableReturnKey:true,
            keyboardType:Titanium.UI.KEYBOARD,
            autocorrect:false,
            hintText:'Email',
            textAlign:'left',
            clearOnEdit:true,
            borderStyle:Titanium.UI.INPUT_BORDERSTYLE_BEZEL,
            clearButtonMode:Titanium.UI.INPUT_BUTTONMODE_NEVER,
        });

        pass  = Titanium.UI.createTextField({
            id:'password',
            backgroundColor:'#eeeeee',
            returnKeyType:Titanium.UI.RETURNKEY_DONE,
            enableReturnKey:true,
            keyboardType:Titanium.UI.KEYBOARD,
            autocorrect:false,
            hintText:'Password',
            passwordMask:true, 
            textAlign:'left',
            clearOnEdit:true,
            borderStyle:Titanium.UI.INPUT_BORDERSTYLE_BEZEL,
            clearButtonMode:Titanium.UI.INPUT_BUTTONMODE_NEVER,
        });
    }
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
    $(document).ready(function() {
        initialize();
    });
    &lt;/script&gt;



</head> <body>
&lt;div id=&quot;container&quot;&gt;
    &lt;div style=&quot;-webkit-border-radius:10px;background:#627C92;padding:3px;width:90%&quot;&gt;
        &lt;div id=&quot;email&quot;&gt;&lt;/div&gt;
        &lt;div id=&quot;password&quot;&gt;&lt;/div&gt;
        &lt;div id=&quot;login&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;  
&lt;/div&gt;



</body> </html>

app.js

var webview = Titanium.UI.createWebView({url:'login.html'});
var win = Titanium.UI.createWindow();
win.add(webview);
win.open();

Comments

  1. Stephen Tramer 2012-07-26

    Helpdesk question, not bug.

JSON Source