Coder Social home page Coder Social logo

Comments (9)

HuaFangYun avatar HuaFangYun commented on May 23, 2024

就是弹出窗口+表单示例(用户名和密码验证的)自己结合看下。

from ant-design-blazor.

icetech233 avatar icetech233 commented on May 23, 2024

就是弹出窗口+表单示例(用户名和密码验证的)自己结合看下。

modal的 onok没法触发

from ant-design-blazor.

HuaFangYun avatar HuaFangYun commented on May 23, 2024

你没有认真看示例程序。再回头看看

from ant-design-blazor.

icetech233 avatar icetech233 commented on May 23, 2024

你没有认真看示例程序。再回头看看

例子里面没有写, model 和 form分开了

from ant-design-blazor.

HuaFangYun avatar HuaFangYun commented on May 23, 2024

你看表单 用户名和密码 验证的第一个就行了

from ant-design-blazor.

HuaFangYun avatar HuaFangYun commented on May 23, 2024
<Modal Title="成本更新"
       @bind-Visible="@_VisibleCost" Footer="null">
    <Form Model="@contractCostViewModel"
          LabelCol="new ColLayoutParam { Span =6 }"
          WrapperCol="new ColLayoutParam { Span = 18 }"
          OnFinish="OnCostFinish"
          OnFinishFailed="OnCostFinishFailed">
        <GridRow>
            <GridCol Span="24">
                <FormItem Label="成本">
                    <Space>
                        <SpaceItem> <AntDesign.InputNumber @bind-Value="@context.Cost" Min="0" Precision="2" Style="width:200px;color:red;"></AntDesign.InputNumber></SpaceItem>
                        <SpaceItem>元</SpaceItem>
                    </Space>
                </FormItem>
            </GridCol>
        </GridRow>

        <div class="ant-modal-footer" style="padding-right:0px;">
            <div>
                <Button Type="@ButtonType.Primary" HtmlType="submit">
                    提交
                </Button>
                &nbsp;&nbsp;
                <Button Type="@ButtonType.Default" @onclick="()=>{_VisibleCost=false;}">
                    取消
                </Button>
            </div>
        </div>
    </Form>
</Modal>

代码给你了,这个可以给关闭了。后台代码你自己看下官网示例组织 下即可

from ant-design-blazor.

khushinj avatar khushinj commented on May 23, 2024

能不能有弹窗表单校验的代码例子?

// 表单验证函数
function validateForm() {
var name = document.getElementById("name").value;
var email = document.getElementById("email").value;
var message = document.getElementById("message").value;

// 检查字段是否为空
if (name == "" || email == "" || message == "") {
    alert("请填写所有字段。");
    return false;
}

// 验证电子邮件格式
var emailRegex = /^\S+@\S+\.\S+$/;
if (!emailRegex.test(email)) {
    alert("请输入有效的电子邮件地址。");
    return false;
}

// 所有验证通过
return true;

}

// 显示弹出表单的函数
function showForm() {
document.getElementById("popupForm").style.display = "block";
}

// 隐藏弹出表单的函数
function hideForm() {
document.getElementById("popupForm").style.display = "none";
}

from ant-design-blazor.

ElderJames avatar ElderJames commented on May 23, 2024

Hello @khushinj , your code is not for blazor

from ant-design-blazor.

icetech233 avatar icetech233 commented on May 23, 2024
<Modal Title="成本更新"
       @bind-Visible="@_VisibleCost" Footer="null">
    <Form Model="@contractCostViewModel"
          LabelCol="new ColLayoutParam { Span =6 }"
          WrapperCol="new ColLayoutParam { Span = 18 }"
          OnFinish="OnCostFinish"
          OnFinishFailed="OnCostFinishFailed">
        <GridRow>
            <GridCol Span="24">
                <FormItem Label="成本">
                    <Space>
                        <SpaceItem> <AntDesign.InputNumber @bind-Value="@context.Cost" Min="0" Precision="2" Style="width:200px;color:red;"></AntDesign.InputNumber></SpaceItem>
                        <SpaceItem>元</SpaceItem>
                    </Space>
                </FormItem>
            </GridCol>
        </GridRow>

        <div class="ant-modal-footer" style="padding-right:0px;">
            <div>
                <Button Type="@ButtonType.Primary" HtmlType="submit">
                    提交
                </Button>
                &nbsp;&nbsp;
                <Button Type="@ButtonType.Default" @onclick="()=>{_VisibleCost=false;}">
                    取消
                </Button>
            </div>
        </div>
    </Form>
</Modal>

代码给你了,这个可以给关闭了。后台代码你自己看下官网示例组织 下即可

Footer="null" ? 可以制空啊

from ant-design-blazor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.