0

I am not an IT professional, I have made a script and running over a website through Tampermonkey Website code:-

<div id="__grid1-wrapperfor-__label44" class="sapUiRespGridSpanL1 sapUiRespGridSpanM3 sapUiRespGridSpanS6 sapUiRespGridSpanXL1">
    <span id="__label44" data-sap-ui="__label44" class="sapMLabel sapUiSelectable sapMLabelRequired sapMLabelMaxWidth DCA-FormLable" style="text-align: left;">
        <span id="__label44-text" class="sapMLabelTextWrapper">
            <bdi id="__label44-bdi">Truck No</bdi>
</span>
<span data-colon=":" class="sapMLabelColonAndRequired">
    </span>
</span>
::after
</div>

<div id="__grid1-wrapperfor-__xmlview3--truckNumber" class="sapUiRespGridSpanL2 sapUiRespGridSpanM3 sapUiRespGridSpanS6 sapUiRespGridSpanXL2">
    <div id="__xmlview3--truckNumber" data-sap-ui="__xmlview3--truckNumber" data-ui5-accesskey="" class="sapMInputBase sapMInputBaseHeightMargin sapMInput DCA-FormField" style="width: 100%;">
        <div id="__xmlview3--truckNumber-content" class="sapMInputBaseContentWrapper" style="width: 100%;">
        <input id="__xmlview3--truckNumber-inner" value="" type="text" autocomplete="off" class="sapMInputBaseInner">
            </div>
</div>
</div>

I want to go to next input of bdi id through Jquery

Earlier the site was using label Id instead of bdi and my code was working very fine

My Code:-

$("label:contains('Truck No')").parent().next().find('input').attr({
            maxlength: "10",
            Autocomplete: "OFF",
            list: "ABC",
            Placeholder: "TRUCK NUMBER",
            autocapitalize:"ON"
            }).after('<Datalist ID=ABC></Datalist>');

i have changed label to bdi in my code but doesn't work

Page image

enter image description here

pls help experts

2 Answers2

0

changing the label to bdi should work the same way as when it was a label

$("bdi:contains('Truck No')").parent().next().find('input').attr({
        maxlength: "10",
        Autocomplete: "OFF",
        list: "ABC",
        Placeholder: "TRUCK NUMBER",
        autocapitalize:"ON"
        }).after('<Datalist ID=ABC>sss</Datalist>');

Hope this helps

Patrick Hume
  • 2,064
  • 1
  • 3
  • 11
  • I tried but not working – Sachin Agrawal Aug 31 '22 at 04:28
  • that strange as that should work, can you use the id instead then ```$("#__label44-bdi")``` you could perhaps look for an element with id that starts with https://stackoverflow.com/questions/23223526/jquery-selector-for-id-starts-with-specific-text then in an for each loop for elements that match have a if check for its text to see if it equals the text your looking for and then work from there, also worth checking out https://stackoverflow.com/questions/7321896/how-can-i-find-elements-by-text-content-with-jquery – Patrick Hume Aug 31 '22 at 17:25
0

You can use sap ui5 framework API.

Alex
  • 101
  • 3
  • Sir i am just an user. Don't know much about IT. the above code is made after 2 month of reading online.. Don't Know Much about sap ui5 framework API. can you help me ? – Sachin Agrawal Nov 29 '22 at 16:23