PDA

View Full Version : Can i get DateField out of form?



skyey
13 Jun 2007, 8:51 AM
Ext.onReady(function(){
//Ext.QuickTips.init();

var fs = new Ext.form.Form({
labelAlign: 'right',
labelWidth: 80
});

fs.fieldset(
{legend:'Contact Information'},
new Ext.form.TextField({
fieldLabel: 'First Name',
name: 'first',
width:190
}),

new Ext.form.DateField({
fieldLabel: 'Date of Birth',
name: 'dob',
width:190,
allowBlank:false
})
);

fs.render('ca');

})


this is example code, can i get DateField out of form? because of asp.net didn't allow two form. (that same code can run into HTML but asp.net can't)

tryanDLS
13 Jun 2007, 9:03 AM
What do you mean 'out of the Form' You don't need to put it in a Form object, if that's what you're asking. Also, I posted example code of how to do forms in .Net - use a BasicForm instead of Form object. It's in the Examples forum somewhere.

skyey
13 Jun 2007, 9:09 AM
thanks, can you post example code instead of form.

my code can ' t run into asp.net

see the whole code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link rel="stylesheet" type="text/css" href="ext/css/ext-all.css" />
<script type="text/javascript" src="ext/js/yui-utilities.js"></script>
<script type="text/javascript" src="ext/js/ext-yui-adapter.js"></script>
<script type="text/javascript" src="ext/js/ext-all.js"></script>
<title></title>
<script>
Ext.onReady(function(){
//Ext.QuickTips.init();

var fs = new Ext.form.Form({
labelAlign: 'right',
labelWidth: 80
});

fs.fieldset(
{legend:'Contact Information'},
new Ext.form.TextField({
fieldLabel: 'First Name',
name: 'first',
width:190
}),

new Ext.form.DateField({
fieldLabel: 'Date of Birth',
name: 'dob',
width:190,
allowBlank:false
})
);

fs.render('ca');

})
</script>


</head>
<body>
<form id="form1" runat="server">
<div id="ca"></div>
</form>
</body>
</html>