Yes, it’s copy-paste with some quick changes. Eg. added id="em_search"
for the text input to be able to reference it with JS in the submit button, and added class em-locations-search-text-default to the input when its value is default (allows to style it gray when default and black when user-selected). Splitting into separate files for shared code is a good idea. Other things worth considering:
1. Move the JavaScript of the submit button to main .js file.
2. Add to that file jQuery code that removes or adds the class em-locations-search-text-default for the text input when the value is changed to default or non-default. Might need to be done in a language-specific .js file created in PHP to allow for default text of different languages.
Or alternatively do it PHP and JS without jQuery straight in the template file. Downside is that this makes one appearance option not adjustable in the same CSS where everything else is:
<input id="" class="" type="text" onblur="if (this.value == '') {this.value = 'Search...';this.style.color = 'gray';}" onfocus="if (this.value == 'Search...') {this.value = '';this.style.color = '#000';}" value="Search..." style="color:gray" name="" autocomplete="off"></input>
3. I’m going to update it to reflect points raised in https://www.ads-software.com/support/topic/sanitization-of-em_search-on-events-list as soon as time permits. Will have to do that for events-search.php as well until the syndication of common code is done.