Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

javascript - extjs vtype does not work on textarea -


ok , have vtype enslish , sign looks this:

ext.apply(ext.form.vtypes, { excel: function (v) {     return /^.*.(xls)$/.test(v); }, exceltext: 'must *.xls file', englishonly: function (v) {     return /^[a-z0-9,\.\~\!\@\#\$\%\^\&\*\(\)\_\+\<\>]*$/.test(v); }, englishonlytest: 'must english letters' 

});

now have form looks this:

new ext.formpanel({     id: 'add-label-form',     url: hp,     frame: true,     baseparams: { actionname: 'addlable' },     defaulttype: 'textfield',     labelwidth: 70,     items: [{         id: 'tbkey',         fieldlabel: localize.key,         allowblank: false,         name: 'tbkey',         anchor: '100%'     }, {         id: 'tbhebrewtran',         fieldlabel: localize.hebrew,         allowblank: false,         name: 'tbhebrewtran',         anchor: '100%'     }, {         id: 'tbenglishtran',         fieldlabel: localize.english,         allowblank: false,         name: 'tbenglishtran',         anchor: '100%'     }, {         id: 'tbdescription',         xtype: 'textarea',         vtype:'englishonly',         fieldlabel: localize.description,         allowblank: true,         name: 'tbdescription',         anchor: '100%'     }],     buttons: [{         text: localize.submit,         formbind: true,         handler: onaddlabelsubmitclick     }, {         text: localize.reset,         handler: function () {             var f = ext.getcmp('add-label-form').getform();             f.reset();         }     }] }) 

the vtype handler called , returns false expected form still valid , no alert displayed on screen... why that?

make sure include monitorvalid: true in formpanel config.

here's comment api explains config option in more detail:

monitorvalid : boolean

if true, form monitors valid state client-side , regularly fires clientvalidation event passing state.

when monitoring valid state, formpanel enables/disables of configured buttons have been configured formbind: true depending on whether form valid or not. defaults false.

with set should see button enabled/disabled , red outline around whatever field vtype applied to.

update:

i noticed text variable englishonly defined englishonlytest, , think should defined englishonlytext (you spelled "test" instead of "text"). if recall correctly framework expects see text appended string want use returned text. may why you're not seeing red outline or popup text.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -