]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/form/Form.js
2 Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(!dojo
._hasResource
["dijit.form.Form"]){
9 dojo
._hasResource
["dijit.form.Form"]=true;
10 dojo
.provide("dijit.form.Form");
11 dojo
.require("dijit._Widget");
12 dojo
.require("dijit._Templated");
13 dojo
.require("dijit.form._FormMixin");
14 dojo
.declare("dijit.form.Form",[dijit
._Widget
,dijit
._Templated
,dijit
.form
._FormMixin
],{name
:"",action
:"",method
:"",encType
:"","accept-charset":"",accept
:"",target
:"",templateString
:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap
:dojo
.delegate(dijit
._Widget
.prototype.attributeMap
,{action
:"",method
:"",encType
:"","accept-charset":"",accept
:"",target
:""}),postMixInProperties:function(){
15 this.nameAttrSetting
=this.name
?("name='"+this.name
+"'"):"";
16 this.inherited(arguments
);
17 },execute:function(_1
){
18 },onExecute:function(){
19 },_setEncTypeAttr:function(_2
){
21 dojo
.attr(this.domNode
,"encType",_2
);
23 this.domNode
.encoding
=_2
;
25 },postCreate:function(){
26 if(dojo
.isIE
&&this.srcNodeRef
&&this.srcNodeRef
.attributes
){
27 var _3
=this.srcNodeRef
.attributes
.getNamedItem("encType");
28 if(_3
&&!_3
.specified
&&(typeof _3
.value
=="string")){
29 this.set("encType",_3
.value
);
32 this.inherited(arguments
);
34 var _4
={returnValue
:true,preventDefault:function(){
35 this.returnValue
=false;
36 },stopPropagation:function(){
37 },currentTarget
:e
?e
.target
:this.domNode
,target
:e
?e
.target
:this.domNode
};
38 if(!(this.onReset(_4
)===false)&&_4
.returnValue
){
39 this.inherited(arguments
,[]);
41 },onReset:function(e
){
43 },_onReset:function(e
){
47 },_onSubmit:function(e
){
48 var fp
=dijit
.form
.Form
.prototype;
49 if(this.execute
!=fp
.execute
||this.onExecute
!=fp
.onExecute
){
50 dojo
.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");
52 this.execute(this.getValues());
54 if(this.onSubmit(e
)===false){
57 },onSubmit:function(e
){
58 return this.isValid();
60 if(!(this.onSubmit()===false)){
61 this.containerNode
.submit();