Fork me on GitHub

With the jQuery Mobile Textinput Widget, we can create text fields and text areas in our app.

Text Field

Text Field Widget

Render Array

var content = {};
content['my_text_field'] = {
  theme: 'textfield',
  attributes: {
    value: 'Hello'
  }
};
return content;

theme('textfield', ...)

var html = theme('textfield', {
  attributes: {
    value: 'Hello'
  }
});
return html;

Text Area

Text Area Widget

Render Array

var content = {};
content['my_textarea'] = {
  theme: 'textarea',
  value:'Hello'
};
return content;

theme('textarea', ...)

var html = theme('textarea', { value: 'Hello' });
return html;