<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InventoryUpdateForm.aspx.cs" Inherits="Medical.MBusiness.SysInventory.InventoryUpdateForm" %>

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" style="padding:20px" runat="server">
    <table class="pt-edit">
        <tr>
            <th>单价</th>
            <td><input type="text" id="iCode" runat="server"/></td>
        </tr>
        <tr>
            <th>单价</th>
            <td><input type="text" id="iPrice" runat="server"/></td>
        </tr>
    </table>
    <div class="pt-padding" style="text-align:center">
        <asp:Button ID="btnSave" class="pt-button active" runat="server" Text="保存" OnClientClick="return InventoryUpdate.validate()" onclick="btnSave_Click" />
        <input type="button" class="pt-button active" onclick="top.OpenClose('InventoryUpdate_Form')" value="关闭" />
    </div>
    </form>
    <script type="text/javascript">
        var InventoryUpdate = (function() {

//            function init() {
//                readonly();
//            }
//            function readonly() {
//                $(".pt-readonly").focus(function() {
//                    this.blur();
//                });
//            }
            function validate() {
                var re = /^-?[1-9]+(\.\d+)?$|^-?0(\.\d+)?$|^-?[1-9]+[0-9]*(\.\d+)?$/;
                var iPrice = $("#iPrice").val() * 1;
                if (!$("#iPrice").val()) {
                    top.showTipsMsg('单价不能为空!', 1, 3000);
                    return false;
                }
                if (!re.test(iPrice)) {
                    top.showTipsMsg('您输入的格式不正确，请重新输入!', 1, 3000);
                    return false;
                    re.lastIndex = 0;
                }
                return true;
            }
//            init();
            return { validate: validate }
        })();
    </script>
</body>
</html>