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 23.01.21 16:46

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 23.01.21 20:15; 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 23.01.21 19:19

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 : 3117
Reputation : 245
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Remove pop up search

Post by EnigmaSpirit 23.01.21 20:04

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 23.01.21 20:09

@EnigmaSpirit try this one then Hello

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

Male Posts : 3117
Reputation : 245
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 23.01.21 20:14

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 23.01.21 21:38

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

Female Posts : 15244
Reputation : 1700
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top

- Similar topics

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