﻿Ext.onReady(function(){
    Ext.QuickTips.init();
    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

    /*
     * ================  检索 form  =======================
     */
    var simple = new Ext.form.Form({
        labelWidth: 50, // label settings here cascade unless overridden
     
        url: "resultlist.aspx",
        baseParams: {action: "formsearch"},
        method: "POST"
    });
    
    simple.on("actioncomplete", function(t,response) {
 
         window.location.replace(response.result.info);

 });

    simple.add(
       q= new Ext.form.TextField({
            fieldLabel: '关键字',
            name: 'q',
            width:105,
            blankText:'关键字不能为空！',
            minLength:2,
             maxLength:50,
             maxLengthText:'输入错误，关键字太长，最多为25个汉字!',
             minLengthText:'输入错误，关键字不能少于1个汉字!',
            allowBlank:false
        })

        
       
    );

  
    simple.addButton('站内检索', function()     
{ 
 if(simple.isValid())
 {
   simple.submit();  
 }
 }
 );
    simple.render('my_form');
    
   
 });