| |

VerySource

 Forgot password?
 Register
Search
View: 655|Reply: 4

Enter 10% and 20% for the two TextBoxes, and subtract 1 from them. The result is automatically displayed in the Label. .

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

Post time: 2020-3-1 20:30:01
| Show all posts |Read mode
Enter 10% and 20% of the two TextBoxes, and subtract 1 from them. The result is automatically displayed in the Label.
Please help me look at what method, thank you
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-12 18:30:01
| Show all posts
TextBox tb1 = new TextBox ();
        TextBox tb2 = new TextBox ();
        Label l1 = new Label ();
        tb2.Attributes.Add ("onblur", "document.all ['l1']. value = 1-document.all ['tb1']-document.all ['tb2']");
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-5-13 13:30:01
| Show all posts
Is it ok to convert to numbers and then subtract?
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-7-4 21:30:02
| Show all posts
How to trigger an event, if written in a script, how to write it
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-7-11 23:30:01
| Show all posts
<script type="text/javascript">
function a()
{
   var a=document.getElementById('TextBox1').value;
   alert(a);
   var b=document.getElementById('TextBox2').value;
   alert(b);
   var c=1-a-b;
   alert(c);
   document.getElementById('Label1').innerHTML=c;
   
}

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server" Style="z-index: 100; left: 105px; position: absolute;
            top: 112px"></asp:TextBox>
        <asp:TextBox ID="TextBox2" runat="server" Style="z-index: 101; left: 104px; position: absolute;
            top: 157px" onblur="a()"></asp:TextBox>
        <asp:Label ID="Label1" runat="server" Style="z-index: 103; left: 107px; position: absolute;
            top: 192px" Text="" ></asp:Label>
   
    </div>
    </form>
</body>
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list