View Full Version : Attaching DatePicker to aTextField
javachap
23 Jul 2007, 12:23 AM
Hi EveryOne,
I know this should be pretty Simple. But could not find that in forums.
How can i attach a DatePicker for an Input Text.
What i have is <input type="text" id="endDate" name="endDate"/>. And all i need to do is attach a DatePicker for this field.
Is there an easy way to do that ??
Thanks in Advance.
-Varma
jack.slocum
23 Jul 2007, 1:33 AM
Ext.form.DateField?
javachap
23 Jul 2007, 1:54 AM
Hi Jack,
Thanks for quick Response.
Ext.form.DateField is used to created a dynamic form field right ?? Correct me if i'm wrong. I'm new to Ext JS.
I want to attach the datepicker for the existing text field. As the text field is rendered via Struts.
Can you please provide some sample code or Link ??
Thanks,
Varma
evant
23 Jul 2007, 2:02 AM
Not necessarily. Check out applyTo in the date field documentation.
http://extjs.com/deploy/ext/docs/output/Ext.form.DateField.html#applyTo
javachap
23 Jul 2007, 2:13 AM
Ext.onReady(function(){
var myDateField = new Ext.form.DateField({
fieldLabel: 'Date of Birth',
name: 'dob',
width:190,
allowBlank:false
});
myDateField.appyTo(Ext.get('endDate'));
});
Tried with above code and No Luck :(
It will be great if anyone provide some example code ???
Thanks,
Varma
javachap
23 Jul 2007, 2:18 AM
Okay it worked !!!
Ext.onReady(function(){
var myDateField = new Ext.form.DateField({
fieldLabel: 'Date of Birth',
name: 'dob',
width:190,
allowBlank:false
});
myDateField.applyTo(Ext.get('endDate'));
});
But it is altering the original text box Look and fell. I'm working on that.
Thank You !!
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.