PDA

View Full Version : how add existing input field to form?



mary
20 Apr 2007, 5:53 AM
hi people

i have such a code in my html file

<input type="text" id="id1" />

and i defined a form

var f = new Ext.form.Form({
labelWidth: 175,
url:'',

});

now i want to add my input field to this form

but i don't know how

help me please!!!!

20 Apr 2007, 7:27 AM
var f = new Ext.form.Form({
fieldLabel: 'your label',
name: 'your name for the input',
width: '111px',
autoCreate: {tag: 'input', id: 'your id'}
});

tryanDLS
20 Apr 2007, 7:28 AM
Did you look at the examples in form folder? Also, there have been numerous threads here regarding forms in the last week - I would suggest you read thru them to understand some of the issues you may run into.

20 Apr 2007, 7:33 AM
Did you look at the examples in form folder? Also, there have been numerous threads here regarding forms in the last week - I would suggest you read thru them to understand some of the issues you may run into.


i know it's where i learn from. :D

sfwalter
20 Apr 2007, 7:37 AM
Is your entire form going to be from existing markup? If so then I think you want to use a BasicForm:



pageForm = new Ext.BasicForm(Ext.get("form1"), {url:'/pages/save', waitMsg:'Please Wait1...' });
var f1 = new Ext.form.TextField({allowBlank:false});
f1.applyTo('page-name');


Here I have an existing text field on the page with an id of "page-name"

scott.

20 Apr 2007, 7:43 AM
The dynamic form function does what it's labled: dynamically creates forms.

Why can't you auto create the form entry?

tim-tailor
3 Jul 2007, 2:20 PM
Exactly what I think.
Would be great to generate forms from json (Fields and Data) as it is possible for Grids

If there is a way please give me a hand :-/

Tim