PDA

View Full Version : Registration Form



chesterx
28 Jan 2008, 8:06 AM
Hi All im a new member of ext forums i liked that and i decided to create a register form but i must do something which were i couldnt do it myself if anyone helps me it made me happy my codes is:
[CODE]

Ext.onReady(function(){

Ext.QuickTips.init();

// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'side';

var bd = Ext.getBody();

bd.createChild({tag: 'h2', html: 'Kayıt Paneli'});

var tab2 = new Ext.FormPanel({
url: 'http://sample.com/doSomething.php',
labelAlign: 'top',
title: 'Kimlik Bilgileri',
frame:true,

bodyStyle:'padding:5px',
width: 620,
items: [{
layout:'column',
border:false,
items:[{
columnWidth:.5,
layout: 'form',
border:false,
items: [{
xtype:'textfield',
fieldLabel: 'Adınız',
allowBlank:false,
name: 'first',
anchor:'90%'
}, {
xtype:'textfield',
fieldLabel: 'TC Kimlik Numaranız',
minLength: 11 ,
maxLength: 11 ,
plugins: [new Ext.ux.InputTextMask('99999999999', true)],
disableKeyFilter:true,
allowBlank:false,
name: 'tckimlik',
anchor:'90%'
}]
},{
columnWidth:.5,
layout: 'form',
border:false,
items: [{
xtype:'textfield',
fieldLabel: 'Soyadınız',
allowBlank:false,
name: 'last',
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: 'E-Mail Adresiniz',
allowBlank:false,
name: 'email',
vtype:'email',
anchor:'90%'
}]
}]
},{
xtype:'tabpanel',
plain:true,
activeTab: 0,
height:500,
defaults:{bodyStyle:'padding:10px'},
items:[{ //items başlıyor
frame:true,

title:'Kişisel Bilgiler',
layout:'form',
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: 'Kullanıcı Adınız',
name: 'first',
allowBlank:false,
value: 'Adınız'
},{
fieldLabel: 'Şifreniz',
name: 'first',
allowBlank:false,
inputType :'password',

},{
fieldLabel: 'Şifrenizi Onaylayın',
name: 'first',
inputType :'password',

allowBlank:false,
vtype:'password'

},{
fieldLabel: 'Soyadınız',
allowBlank:false,
name: 'last',
value: 'Soyadınız'
},
new Ext.form.DateField({
fieldLabel: 'Doğum Tarihiniz',
name: 'dob',
width:190,
allowBlank:false,
}),

new Ext.form.ComboBox({
fieldLabel: 'Iliniz',
typeAhead: true,
hiddenName:'state',
selectOnFocus:true,
loadingText: 'Y

Hunterman
28 Jan 2008, 8:46 AM
and there are two state combobox i want to do this user will select the first one for example "a" city i want to the second one will load the city's part if the first one will change the second one must be reloaded i wish i can write my problems well :(

I have solved this question so - there are two tables of data 'companyId' and 'setdogovorId'

At choice Combo - with the companies I obtain data from Contracts
. There is an inquiry to " Ext.getCmp (' comp ') .on (' select ', " and there is a loading melon setdogovorId.load ({params: {task: "readsetdogId", ask: setIDcomp}});



var simple = new Ext.FormPanel({
labelAlign: 'top',
url:'savedopdog.php',
method: 'POST',
bodyStyle:'padding:5px',

items: [
{
xtype:"combo",
store: companyId, //<- data company
id: "comp", // <-- id combo company
valueField: 'cid',
hiddenName:'fullname',
displayField:'fullname',
fieldLabel: 'Company',
name: 'company',
width: 400,
typeAhead: true,
mode: 'local',
triggerAction: 'all',
selectOnFocus:true,
allowBlank:false

},{

xtype:"combo",
store: setdogovorId, // <-- data Contracts
id: "comp-dop",
valueField: 'dog_id',
hiddenName:'number_dog',
displayField:'number_dog',
fieldLabel: 'Contracts',
name: 'number_dog',
width: 400,
typeAhead: true,
mode: 'local',
triggerAction: 'all',
selectOnFocus:true
//,allowBlank:false


}],

buttons: [{
text: 'Save',
waitMsg:'Wait....',

handler: SubmitFormSave
},{
//handler: function() {simple.form.reset(); },
text: 'Clear'
}]
});

Ext.getCmp('comp').on('select', function(){
Ext.getCmp('comp-dop').reset();
var setIDcomp = Ext.get('comp').dom.value;
setdogovorId.load({params:{task: "readsetdogId",ask: setIDcomp}}); //<-- load data from Contracts

}, true);

chesterx
28 Jan 2008, 8:52 AM
I have solved this question so - there are two tables of data 'companyId' and 'setdogovorId'

Thanks for the reply but i said im too starter of these could you share your opinion on my codes i explored the ext only 3-4 days ago sorry :S
so i want to say could you change the codes with your opinion:S

chesterx
28 Jan 2008, 9:33 AM
and i want to do enter button to submit but how:(

para
28 Jan 2008, 9:36 AM
and i want to do enter button to submit but how:(

Search the forum.

chesterx
28 Jan 2008, 9:59 AM
ok i searched the forum i found some notes thanks @para i must write a function for passford validation pass1! == pass2! like this can you help me?


and ive a big problem my codes dont work on ie6 :(


and i said the upside post on tabpanel i coulndt create column ill add the screenshot now

chesterx
29 Jan 2008, 5:37 AM
@hunterman i did your opinion succesfully its working but i want to do on my first tabpanel two columns ill be crazy i couldnt do it :( please help me to do that

cadudecastroalves
29 Jan 2008, 9:14 AM
ok i searched the forum i found some notes thanks @para i must write a function for passford validation pass1! == pass2! like this can you help me?

Hi, chesterx.

I'm using the following solution to check passwords:


items: [{
inputType: 'password',
fieldLabel: 'Confirmar Senha',
name: 'account_confirm_passwd',
id: 'account-confirm-passwd',
maxLength: 32,
tabIndex: 4,
anchor: '95%',
listeners: {
change: function() {
var passwd = Ext.getCmp('account-passwd'); // get the first pass field
var retypePasswd = Ext.getCmp('account-confirm-passwd'); // get the confirm (or the second) pass field
if(passwd.getValue() != retypePasswd.getValue()) { // compares both values
Ext.Msg.show({
title: 'Error',
msg: 'The typed passwords are different. Try again.',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
this.markInvalid('You must fill in both password fields with the same password.');
this.focus(true);
}
}
}
}]


It works in my application. I hope you understood.

cadudecastroalves
29 Jan 2008, 9:33 AM
@hunterman i did your opinion succesfully its working but i want to do on my first tabpanel two columns ill be crazy i couldnt do it :( please help me to do that

@chesterx: Read in the docs about column layout. It's exactly about you want. If you hope for any reply, probably you never going to learn anything. I had so much difficulties to learn how to read and understand the docs, but now I know and I make lots of things without making questions here in the forum.

It's so hard to learn in the beginning. But now I can do lots of things by myself, just reading the docs. When I didn't achieve doing anything by myself, I search a lot in the forum. If I spend lots of time, I make a question here. But I never ask for anybody to do anything to me. I just ask for help. Do you get what I mean?

So, I hope you learn a lot here and I hope you achieve solve this problem, too.

Best regards!

chesterx
30 Jan 2008, 2:47 PM
@cadudecastroalves thanks for the reply before i understood you what you want to say about im reading the docs and try to make something by myself some function i cant called how i can say i dont know what is it name how i can explain my opinion to the search i did a form with @hunterman's opinion its working but i cant do all states and cities example im trying to do i must learn the column subject if i need a help ill be back to here thanks for all


but ive a problem i cant do that dop you know why the form doesnt work on ie6 im goingto be crazy :(

chesterx
22 Feb 2008, 10:46 AM
[PHP]Ext.namespace('Ext.exampledata');

Ext.exampledata.iller = [
['01', 'Adana' ],
['02', 'Adıyaman' ],
['03', 'Afyon' ],
['04', 'Ağrı' ],
['05', 'Amasya' ],
['06', 'Ankara' ],
['07', 'Antalya' ],
['08', 'Artvin' ],
['09', 'Aydın' ],
['10', 'Balıkesir' ],
['11', 'Bilecik' ],
['12', 'Bing

chesterx
22 Feb 2008, 1:33 PM
nobody answer? :(

para
22 Feb 2008, 5:27 PM
I'd do it like this: It would probably be easier if the list was kept in a data store instead of an array, but it's not bad this way.

[CODE]
new Ext.form.ComboBox({
id: 'iller',
fieldLabel: 'Iliniz',
typeAhead: true,
selectOnFocus: true,
loadingText: 'Y

chesterx
23 Feb 2008, 10:01 AM
@para Thanks for the reply im working on it now