I’m trying to place a Reset button on top and the bottom of an Advanced Search Form. I’m placing the following code on the page’s Client Scripts/ Search Page/ Startup Script:if (ew.IS_LOGGEDIN && ew.PAGE_ID == “search”) {
$(‘body’).prepend(“#btnReset”).click();
$(“#btnReset”).click();
}But it is not working for showing the button on top of the form. It only appears at the bottom beside the Search Button.
Can anyone help me or point me in the right direction?
You should find the first div in the form and insert before that. For example:
$div = $(".ew-search-form").find("div").first();
$btn = $("#btn-reset");
$btn.insertBefore($div);
Hi Michael, I tried this but it does not seem to find the div tag and put the button on top. I used the same code you gave me. Do I need to modify it?$div = $(“.ew-search-form”).find(“div”).first(); <---- In this case, does the dot has to go before ew?
$btn = $(“#btn-reset”);
$btn.insertBefore($div);
Are you using ASP.NET Maker 2021?
Hi Michael, I’m using ASP Maker 2020.
Use the browser Inspect button to check the search form/reset button class names.