Skip to content

Conversation

@NCowoski
Copy link
Contributor

The search field on full sized screens has been broken for quite some time.

The changes I added will allow both to be used together on the index.cfm and on all other pages as well.

I did kinda throw this together. Any suggestions would be appreciated if declined.

@pfreitag
Copy link
Member

pfreitag commented Oct 29, 2025

hmm, I think we could just do this:

function submitSearch(e) {
    e.preventDefault();
    var newLocation = $('#lookup-box').val().toLowerCase();
    if (newLocation.length > 1) {
        document.location = '/' + encodeURIComponent(newLocation);
    }
}

There should only be one element with the id of lookup-box on the page, no need to get fancy like it was, and there is no reason to redirect to /

@NCowoski
Copy link
Contributor Author

NCowoski commented Oct 29, 2025

The reason its happening is there are 2 inputs with Lookup-box as their ID, one is only visible when mobile. Which is why I wanted to get the closest one.

The 2nd one was added 7-8 months ago in a commit if you look at the index history.

But I do agree, I could have done it cleaner.

@pfreitag
Copy link
Member

ah I see, so we probably should be using a class instead of an id then if there are two elements with the same id - I will merge this for now if you want to make it better feel free

@pfreitag pfreitag merged commit 7ae3099 into foundeo:master Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants