Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
187 views
in Technique[技术] by (71.8m points)

c# - If the value of a field overcross maximum amount, another hidden checkbox shall now become visible

I am new to razor in C# and I want the following: if the value of the dx-field "Betragssumme" changes, the javascript-function CheckAwvMinBetragUeberschritten should be called. There it will be checked if the amound is higher than desired. If it is so, the checkbox should not be hidden anymore.

I have two problems. First I dont know how to debug this javascript code. I already wrote debugger; in it but no debugging happens. And the bigger problem is, my code does not do what I want. The checkbox is hidden under any condition. I dont know how to debug and I dont know what mistake I do. Help please

                <div class="dx-field">
                    <div class="dx-field-label">Betragssumme:</div>
                    <div class="dx-field-value mb-3">@(Html.DevExtreme().NumberBox().ID("AufteilungSumme").Format(new JS("WaehrungsFormat")).ReadOnly(true).Placeholder("0,00") .OnValueChanged("CheckAwvMinBetragUeberschritten"))
                        </div>
                </div>

            <div class="dx-checkbox" style="margin-bottom: 20px" hidden="true" id="AwvField"  onclick="IstAwvMeldepflicht()">
            AWV-Meldepflichtig:
            </div> 

And here is the Javascript-Function

function CheckAwvMinBetragUeberschritten(e) {
    debugger;
    var betragsSumme = $("#AufteilungSumme").dxNumberBox("instance").option("value");

    if (betragsSumme > model.AwvMinBetrag) 
    {
        var field = document.getElementById("AwvField");
        field.hidden = false;
        field.visibility= vi

    }
}
question from:https://stackoverflow.com/questions/65865944/if-the-value-of-a-field-overcross-maximum-amount-another-hidden-checkbox-shall

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...