SEARCH FUNCTION? - Post ID 247044

User 2747726 Photo


Registered User
27 posts

Can a search function be added to a site using HTML Editor?
User 38401 Photo


Senior Advisor
10,951 posts

Hiya Mathew,

You can add a search function to any site if it is a script created for an HTML site. The HTML Editor doesn't tell you what you can and cannot use in it, it's fully code so you can add or remove any code you want, it's basically a glorified text editor with a lot of bonus functions. You can add anything you want to a site when you code it yourself. :)
User 2747726 Photo


Registered User
27 posts

Let me rephrase the question: Does html editor have the functionality to create from nothing a fully operational search field? If not, what software does?

User 2764672 Photo


Registered User
17 posts

Hi Mathew...
I don't believe a plain vanilla HTML search function can be created that will work outside the page it is created in. You might need a lot more than what is described below to search the whole site or the Internet itself. So if those limitations don't bother you... Go for it.

Most web editors can make a form. The CSS part is only to jazz it up. For a basic text form, it's not needed. 'Submit' is part of the form building function. How well the form works depends on what you want to look for. Without some fancy code, it will be limited to whatever is in your page that has readable text, not the whole site. If you need to search the Internet from your web page, use Google personal.

You will need to decide the 'action' you want. Most forms are used to send email but I can't see any reason why you can't have one display the results on the screen.

Below is very basic HTML you will need to create a form. Take out reference to a CSS wrapper called # searchfield if you can do without the the visual part of the form. The 'placeholder' text is what shows in the field you will enter your search query in. The form wrapper #searchfield just describes how 'visual' your created form will look with CSS.

It's not essential because most web editors have everything you need for a plain vanilla form. You will still need the action function to describe what to do with the form. I'd use a PHP form myself but the coding might stump you if you are not up to speed with the language.

<form id="searchfield" action="">
<input id="search" type="text" placeholder="your search">
<input id="submit" type="submit" value="Search">
</form>

You can do this with most HTML editors. Form is a fairly standard function. The submit button is part of 'form' some versions of IE versions cannot use the placeholder statement and Opera prior to 11 can't style it. Chrome has a bug in it that doesn't let some CSS features work either.

If you want 100% functionality with most browsers, Stick to plain text forms. Maybe you can use CC form builder to make the form but I've never had a great deal of success getting any CC form into my web pages. There are instructions on how to do it so maybe stuff simpler than I make will blend in better.

Good luck, I hope this helps.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.