I am new to Javascript and have some code I need to edit. Please can someone suggest how i can get this function to work without clicking the <ul> class ct-group ?
When you click on below it loads the function, but i need it to auto load.
Added code for button
Tried the below code - I get the alert, but the button still doesn't click as when clicking from the UL.
Code:
function triggerCTPartButtonClick(oUL) {
try {
optionalLog('man', 'triggerCTPartButtonClick');
$(oUL).parent().parent().find("button.partselect").click();
} catch (ex) {
console.log(ex.message);
}
}
Code:
strGroup = gfCStr(objRs("Group"))
if strGroup <> "" then
%><ul class="ct-group" onclick="triggerBootPartButtonClick(this);"><%
strSplit = split(strGroup, ",")
for intcount = 0 to ubound(strSplit)-1
strItem = strSplit(intcount)
if (strItem <> "") then
%><li><%=strItem%></li><%
end if
next
%></ul><%
end if
%>
Code:
<button class="fixmed partselect"
data-ldLength = ""
data-term1 = "<%=gfCStr(objRs("Term1"))%>"
data-term2 = "<%=gfCStr(objRs("Term2"))%>"
data-ldCPBoot = "<%=gfCStr(objRs("Boot1"))%>"
data-ldDTBoot = "<%=gfCStr(objRs("Boot2"))%>"
data-ldLeadQty = "1"
data-ldQtyReq = "<%=gfCStr(objRs("QtyReq"))%>"
data-ldLocation = ""
data-place="vwcutlist"
data-docmode="<%=docmode%>"
data-docref="<%=docref%>"
data-part="<%=gfCStr(objRs("PartNo"))%>"
data-wo="<%=gfCStr(objRs("Works"))%>"
data-tray="<%=gfCStr(objRs("Tra"))%>"
data-cable="<%=gfCStr(objRs("Cabl"))%>"
onclick="selectListPart(this, 'vwwo');"><%=gfCStr(objRs("PartNo"))%>
</button>
Tried the below code - I get the alert, but the button still doesn't click as when clicking from the UL.
Code:
(function () {
try {
alert("hello")
optionalLog('man', 'triggerCTPartButtonClick');
$("button.partselect").click();
} catch (ex) {
console.log(ex.message);
}
}
)();
</script>