locked
asp button and resource file RRS feed

  • Question

  • User-944424728 posted

    Hello, Screen reader currently says "button Next right arrow right arrow"  (Next >>) so how can I  hide the ">>"

    this is asp button

    <asp:Button ID="btnNext2" runat="server" class="formbutt" CausesValidation="false" Text="<%$ Resources: Resource, _Next %>" OnClick="btnNextClick" aria-label="<%$ Resources:Resource,lbtnNext %>"/>

    --this is resource file

    _Next  = Next >>

    -- I tried 

    Next <span aria-hidden="true"> >> </span> but it won't work because text is in property of an input

    I added aria-hidden=" />>"  in asp: button, screenreader read "blank" on the next >> button.

    --browser html code

    <input type="submit" name="ctl00$Main_content$btnNext2" value="Next >>" id="ctl00_Main_content_btnNext2" class="formbutt" aria-label="Next">

    --

    is there a jquery or javascript that I can find value="Next >>" and add attribute aria-hidden like example below Please advise. Thanks.

    $(document).ready(function () {

    $('#ctl00$Main_content$btnNext').attr("aria-hidden", "true");

    Tuesday, May 12, 2020 11:56 AM

All replies

  • User288213138 posted

    Hi aspvbnet,

    is there a jquery or javascript that I can find value="Next >>"

    If you want to fine the value in input textbox, you can try below code:

    var value = $('#id').val();

    add attribute aria-hidden like example below Please advise. Thanks.

    $(document).ready(function () {

    $('#ctl00$Main_content$btnNext').attr("aria-hidden", "true");

    If you want to add attribute to the input textbox, does attr() method not meet your needs?

    Your id is incorrect, It should be ctl00_Main_content_btnNext2.

    Best regards,

    Sam

    Wednesday, May 13, 2020 3:40 AM
  • User-944424728 posted

    Hello, I got the script but not sure why it's not working in Chrome but IE only.  do you know how I can make this script work in chrome browser?

    <script>
    $(document).ready(function () {
    if ($('#ctl00_Main_content_btnNext2').length) {
    var btnVal = $('#ctl00_Main_content_btnNext2').prop('value');
    if (btnVal === 'Next >>' || btnVal === 'Próximo >>' || btnVal === 'Suivan >>') {
    $('#ctl00_Main_content_btnNext2').attr('aria-label', btnVal.replace(' >>', ''));
    }
    }
    });
    </script>

    Wednesday, May 13, 2020 11:32 AM
  • User288213138 posted

    Hi aspvbnet,

    Hello, I got the script but not sure why it's not working in Chrome but IE only.  do you know how I can make this script work in chrome browser?

    I tested your code in chrome, it works fine on my site.

    Please use F12 to set breakpoints to debug your code.

    Best regards,

    Sam

    Thursday, May 14, 2020 8:28 AM