2016-04-28 6 views
0

のボタンをクリックした後、私は自分のWebページ内のリンクを持つページへのリダイレクト:このリンクをクリックするとはポップアップ

<a class="dropdown-item" href="#" onclick="ChangePasswordPopup();">Change your password</a> 

、ポップアップを以下のように定義開き:

function ChangePasswordPopup() 
{ 
    var html=""; // to store the html content 

    // Build the content of the change password popup form 
    html+="<div class='col-md-12 divChangePasswordPopup' id='divChangePasswordPopup'>"; 
    html+="<div class='divBackground' id='divBackground' onclick='ClosePopup();'></div>"; 
    html+="<div class='panel panel-primary divForeground' id='divForeground'>"; 
    html+="<div class='panel-heading'>"; 
    html+="Change your password"; 
    html+="<a href='#' onclick='ClosePopup();' id='CloseButtonLink' title='close'>"; 
    html+="<span class='glyphicon glyphicon-remove' style='float: right; font-size: 18px; padding: 3px 3px 0px 0px;'></span>"; 
    html+="</a>"; 
    html+="</div>"; 
    html+="<div class='panel-body'>"; 
    html+="<form name='frmChangePassword' onsubmit='ChangePassword(this);'>"; .....form textboxes goes here..... 
    html+="<button type='submit' name='btnSave' class='btn btn-primary-outline'"; 
    html+="style='position: relative; float:right;'>Save Changes <i class='glyphicon glyphicon-chevron-right'></i></button>"; 
    html+="<br/></div></li></form></div></div></div>"; 

    $("#divChangePasswordPopup").html(html);  
    disablescroll(); // disable the scrollbar for the webpage  
    return(false); // to prevent the calling form from executing  
} 

これは、ワーキング。私は、保存ボタンをクリックしようとすると、私は単に別のページにリダイレクトするようにしたいので、私はこれをしなかった:

function ChangePassword(frm) 
{ 
    window.location="login.php"; 
    return(false); // to prevent the calling form from executing 

} 

しかし、それは働いていません。私は同じウィンドウを使用する場合は、Webページ上の通常のボタンでそれが動作している場所。しかし、それをポップアップで使用すると、機能しません。どのように私はポップアップフォーム上のボタンをクリックし、ログインページにリダイレクトできるのか知っていますか?

the problem in jsfiddle code

+2

'window.location.href = "login.php";' – DININDU

+0

window.location.hrefはどちらか動作しません。ボタンがWebページにある場合は機能していますが、 –

+0

答えて

0

試してみてください。

function ChangePassword() 
{ 
    window.location.href = 'login.php'; 
    return false; 
} 
関連する問題