skye 2011-06-22 16:04:57 3711次浏览 1条回复 0 0 0
<?php echo CHtml::form(CHtml::normalizeUrl(array('mail/upload')),'post',array('enctype'=>'multipart/form-data', 'id'=>'uploadForm', 'style'=>'display:none')); ?>
<?php echo CHtml::fileField('attchmentfile'); ?>
<?php echo CHtml::button('添加附件', array('onclick'=>'MailList.uploadAttchment()')); ?>
<?php echo Chtml::submitButton('submit'); ?>
<?php echo CHtml::endForm(); ?>
</div>

这里有一个普通按钮和提交按钮,用提交按钮能够提交,用普通按钮可以提交吗?

uploadAttchment: function (){
    $.ajax({
        'type' : 'POST',
        'url'  : $('#uploadForm').attr('action'),
        'data' : $('#uploadForm').serialize(),
        'complete' : function(){
            //ShopSave_busy = false;
        },
        'error': function (t) {
            //alert(t.responseText);
        },
        'success' : function (data){
            
        }
    });
},
您需要登录后才可以回复。登录 | 立即注册