| |

VerySource

 Forgot password?
 Register
Search
Author: yoto999

I have been engaged in .net development for a year and a half, and encountered a very difficult problem (how to cancel t

[Copy link]

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-5-19 19:30:01
| Show all posts
Have you tried thepapaibobomethod?
<asp: RadioButtonList ID = "RadioButtonList1" runat = "server">
            <asp: ListItem onclick = "set (this);"> a </ asp: ListItem>
            <asp: ListItem onclick = "set (this);"> b </ asp: ListItem>
        </ asp: RadioButtonList> </ div>

    <script>
        var id = "";
        function set (c)
        {
            
            if (c.id == id)
            {
                c.checked = false;
                id = "";
            }
            else
                id = c.id;
        }
    </ script>

I tried it, it seems not work ~~~~
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-26 18:15:02
| Show all posts
Interesting, pay attention.
Reply

Use magic Report

0

Threads

12

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 Invalid IP Address

Post time: 2020-5-26 18:45:01
| Show all posts
Such as:sunray
If it is a static page
===============================================
Reply to:ppaannyyjj() Reputation: 1002017-01-04 21:19:43 Score: 0
I don't use radiobuttonlist very much, but I think javascript can be achieved

var obj = document.getElementById ("rblist");
obj.option [0] .checked = false;

Didn't try it, probably this is it
==============================================
If it is an aspx page, the server control should have the value of ViewState. Javascript can change the value of the html control, but the value of the view cannot be changed. JavaScript seems to have been canceled, but it is actually an illusion.

=========================
Personally think: javascript can make an effect but it is actually an illusion
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-6-6 17:00:02
| Show all posts
Is it really unachievable?
If I couldn't find a way before get off work, I had to use two checkboxes instead. . . (But it's very troublesome)
I hope the experts can help me. . .
Thank you~~~~~~~~~~~
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-6 20:15:01
| Show all posts
Work around, make another checkbox (do not select any of the above), the client makes the checkbox fully Disabled, and the server takes this value and thinks that it is not selected
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-6 21:30:01
| Show all posts
PageLoad:

rblVersionSet.Items[0].Attributes.Add("onclick", "XXXXXXXXXX(this);");
rblVersionSet.Items[1].Attributes.Add("onclick", "XXXXXXXXXX(this);");

page:
<script type="javascript">
    function XXXXXXXXXX(rbt)
    {
       if (rbt.Checked==true)
           rbt.checked = false;
       else
          rbt.checked = true;
     }
</script>
Reply

Use magic Report

0

Threads

1

Posts

0.00

Credits

Newbie

Rank: 1

Credits
0.00

 China

Post time: 2020-6-6 23:55:00
| Show all posts
Passing by learning
Reply

Use magic Report

0

Threads

5

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-12 22:00:02
| Show all posts
Such as:sunray
If it is a static page
===============================================
Reply to:ppaannyyjj() Reputation: 1002017-01-04 21:19:43 Score:0
I don't use radiobuttonlist very much, but I think javascript can be achieved

var obj = document.getElementById("rblist");
obj.option[0].checked = false;

Didn't try it, probably this is it
==============================================
If it is an aspx page, the server control should have the value of ViewState. javascript can change the value of the html control, but the value of the view cannot be changed. JavaScript seems to have been canceled, but it is actually an illusion.

=========================
Personally think: javascript can make an effect but it is actually an illusion

================================================== ======================
That's right, I think it's really going to be realized
First use the background program to write checked = false
The second obj.option[0].checked = false; the background program reads using response.form[""], it is not necessary to use the things in ViewState
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-23 16:30:01
| Show all posts
This is definitely achievable, wait, I try
Reply

Use magic Report

0

Threads

9

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-6-25 22:00:01
| Show all posts
It is possible to use JAVASCRTIPT, but it is troublesome. The best way is to use the new thing ATLAS, which is launched to make the page update asynchronously, and can achieve many JAVASCRIPT effects.
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