[TIMOB-2971] Create textfield in html file using titanium api
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-07-26T13:25:24.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | davidlee |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:33:56.000+0000 |
Updated | 2012-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>
<link rel="stylesheet" href="css/pub.css" type="text/css" media="screen">
<script type="text/javascript" charset="utf-8" src="script/jquery.js"></script>
<script type="text/javascript" charset="utf-8">
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,
});
}
</script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
initialize();
});
</script>
</head> <body>
<div id="container">
<div style="-webkit-border-radius:10px;background:#627C92;padding:3px;width:90%">
<div id="email"></div>
<div id="password"></div>
<div id="login"></div>
</div>
</div>
</body> </html>
app.js
var webview = Titanium.UI.createWebView({url:'login.html'});
var win = Titanium.UI.createWindow();
win.add(webview);
win.open();
Helpdesk question, not bug.