The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Remove pop up search

3 posters

Go down

Solved Remove pop up search

Post by EnigmaSpirit January 23rd 2021, 5:46 pm

Good Morning,

I am trying to remove the pop up search from my forum and instead have the navigation bar just link to the search page. The code has the onclick property to fire the search box, I can't find a way to remove this as it's not accessible in the templates.

Here's a screenshot of why I want to remove it, it falls behind the #wrap in my code.

Remove pop up search Screen10

My forum link is pogoraids.forumotion.com, accessible at pogoraiders.com.. Forum version is ModernBB

Edit: the code that shows in dev console is

Code:
<a class="mainmenu" href="/search" onclick="showhide(document.getElementById('search_menu')); return false;" target="_blank">Search</a>

So i tried to override using

Code:
const a = document.querySelector('.mainmenu');
a.onclick = null;
a.removeAttribute('target');

However this does nothing.


Last edited by EnigmaSpirit on January 23rd 2021, 9:15 pm; edited 1 time in total
EnigmaSpirit
EnigmaSpirit
New Member

Posts : 6
Reputation : 2
Language : English

http://www.pogoraids.forumotion.com

Back to top Go down

Solved Re: Remove pop up search

Post by Niko January 23rd 2021, 8:19 pm

Dear @EnigmaSpirit,

have you tried with this?
Code:
$(function() {
    const a = document.querySelector('.mainmenu');
    a.onclick = null;
    a.removeAttribute('target');
});

Let me know :rose:
Niko
Niko
Helper
Helper

Male Posts : 3100
Reputation : 244
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Remove pop up search

Post by EnigmaSpirit January 23rd 2021, 9:04 pm

Niko wrote:Dear @EnigmaSpirit,

have you tried with this?
Code:
$(function() {
    const a = document.querySelector('.mainmenu');
    a.onclick = null;
    a.removeAttribute('target');
});

Let me know :rose:

This does not work.
EnigmaSpirit
EnigmaSpirit
New Member

Posts : 6
Reputation : 2
Language : English

http://www.pogoraids.forumotion.com

Back to top Go down

Solved Re: Remove pop up search

Post by Niko January 23rd 2021, 9:09 pm

@EnigmaSpirit try this one then Hello

Code:
$(function() {
$('.mainmenu[href="/search"]').attr('onclick',null);
});
Niko
Niko
Helper
Helper

Male Posts : 3100
Reputation : 244
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

skouliki and SarkZKalie like this post

Back to top Go down

Solved Re: Remove pop up search

Post by EnigmaSpirit January 23rd 2021, 9:14 pm

Niko wrote:@EnigmaSpirit try this one then Hello

Code:
$(function() {
$('.mainmenu[href="/search"]').attr('onclick',null);
});

You are amazing, thank you!
EnigmaSpirit
EnigmaSpirit
New Member

Posts : 6
Reputation : 2
Language : English

http://www.pogoraids.forumotion.com

Niko likes this post

Back to top Go down

Solved Re: Remove pop up search

Post by skouliki January 23rd 2021, 10:38 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
skouliki
skouliki
Manager
Manager

Female Posts : 15061
Reputation : 1690
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum