Nov 30, 2011, 9:17 AM
[CLOSED] Ext.Msg.Show Configuration
I configured Ext Message like below to get name from user and validating on ok button. i would like to retain the msg box if validation fails.
Can you tell me how to do this?
sample code:-
Can you tell me how to do this?
sample code:-
<%@ Page Language="C#"%>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function GetUserName() {
Ext.Msg.show({
title: 'Enter Name',
msg: "<input type='text' id='userNameTxt'>",
buttons: { ok: "Ok", cancel: "Cancel" },
fn: function (btn) { return GetUserNameHandler(btn); }
});
}
function GetUserNameHandler(btn) {
if (btn == 'ok' && document.getElementById('userNameTxt').value == '') {
return false;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager" runat="server"></ext:ResourceManager>
<div>
<button onclick="GetUserName()">Click</button>
</div>
</form>
</body>
</html>
Last edited by Daniil; Dec 01, 2011 at 2:12 PM.
Reason: [CLOSED]