1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    78
    Vote Rating
    0
    nromanel is on a distinguished road

      0  

    Default Binding Fields to a Form for Validation?

    Binding Fields to a Form for Validation?


    Hi All...

    I have fields placed around my page using the following:

    Code:
    var weekNumField = new Ext.form.NumberField({
    	id: 'weeklyNum-field',
    	allowDecimals: false,
    	maxValue: 52,
    	minValue: 1,
    	allowNegative: false,
            allowBlank: false,
    	renderTo:'weeklyNum',
    	name:'RecurEvery',
    	value: '1',
    	width: 25,
    	disabled: true
    });
    And the target for these fields are within a label in a form panel:
    Code:
    {
    xtype:'label',
    cls:'x-form-item',
    html:'Recur every <span id="weeklyNum"></span> week(s) on:'  
    }
    When I submit the form, the field is not checked for validity.

    If the field is invalid (by simply clicking into the field and leaving it empty) the form will still submit.

    Do I need to check for this manually in the listener for the submit button? Or is there some way to bind this field to the form?

    Thanks for the help!!

  2. #2
    Sencha - Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    26,173
    Vote Rating
    82
    jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold jsakalos is a splendid one to behold

      0  

    Default


    Do not cross-post or post same post more than once. It only decreases you chance to get help.