<script>
var fjmc=window.parent.document.all.fjmctext.value
document.getElementByIdx_x_x_x("aaa").value = fjmc
myForm.action="collectionSendToExcel.action"
myForm.submit()
</scritp>
<form action="#" id="myFormToExcel" name="myFormToExcel">
<input type="hidden" name="fjmc" id="aaa" />
<input type="text" name="action" />
<input type="submit" value="提交'>
</form>
通过Ajax传递:
function commit(){
var myMask = new Ext.LoadMask(Ext.getBody(), {msg: '正在提交数据,请稍后...'})
myMask.show()
Ext.Ajax.request({
form: 'myForm',
method: 'post',
success: function(response, option){
myMask.hide()
var results = Ext.util.JSON.decode(response.responseText)
var msgs = '【承兑保证操作成功!】'
switch(results.type){
case '1':
msgs = '【保证人账号不能为空,操作失败】'
break
case '2':
msgs = '【访问数据库发生异常,操作失败】'
break
}
Ext.Msg.show({
title:'信息提示',
modal:false,
msg: msgs,
buttons: Ext.Msg.OK,
fn:function(btn,text){
if(btn == 'ok'){
if(results.success){
comBack(g('SBillType').value)//返回列表
}
}
},
animEl: 'elId',
icon: Ext.MessageBox.INFO
})
},
failure: function(response,option){
myMask.hide()
Ext.MessageBox.alert("信息提示","【提交数据超时,请稍候再试...】")
}
})
}
直接post提交数据就行了
<script> function getTrObjsValue(trObjsArr) { if (trObjsArr == null || trObjsArr.length == 0) return '' var str = '' for (var i = 0 i < trObjsArr.length i++) { var tdChilds = trObjsArr[i].getElementsByTagName('TD') for (var j = 0 j < tdChilds.length j++) { var name = tdChilds[j].getAttribute('name') //获取当前列对应的<col/>的列名 alert('name=' + name) var value = tdChilds[j].getAttribute('value') //获取选中行的当前列的数据 alert('value=' + value) if (name && name != '') { str = str + '[列名:' + name + ';列值:' + value + ']' } } } $.ajax({ type: 'POST', data: {}, url: 'xxxxxx.do?str='+str, complete: function (xhr) { var rst = xhr.responseText if (rst == '1') alert('添加成功!') else alert(rst) } }) return str }</script>