日期:2014-05-16  浏览次数:20515 次

jQuery ui dialog问题。高分在线等
JScript code

function remitFail(code){
                $( "#dialog").dialog( "destroy" );    
                $( "#dialog-confirm-info").html("<textarea rows='4' cols='40'id='reason'></textarea>");
                $( "#dialog-confirm" ).dialog({
                    title:'失败原因',
                    resizable: false,
                    height:200,
                    modal: true,
                    
                    buttons: { "确定": function() {
                               $( this ).dialog( "close" );
                               if(null != code && "" != code){
                                    var url = "remitFail.action?code="+code;
                                    [color=#FF0000]alert($("#dialog-confirm-info").children("#reason").text())[/color]                                    //window.location.href = url;
                                }else{
                                    alert("操作失败,编号不能为空.");
                                }
                               
                             },
                               "取消": function() { $( this ).dialog( "close" );}}
                });
                
            }




在textarea中输入内容后,红色字体部分获取不到值。大家帮忙看看什么原因。谢谢了。

------解决方案--------------------
你干嘛要这么写呢,直接
JScript code
alert($('#reason').val());

------解决方案--------------------
探讨

你干嘛要这么写呢,直接JScript code
alert($('#reason').val());
就行了吧