disabled input history for search field
This commit is contained in:
parent
e28c1adb5e
commit
d16b33e521
|
@ -2,7 +2,7 @@
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<form id='sform' method='post' action='https://s.rdsm.ca/search'>
|
<form id='sform' method='post' action='https://s.rdsm.ca/search'>
|
||||||
<input type='text' id='search' name='q' placeholder='Search'>
|
<input type='text' id='search' name='q' placeholder='Search' autocomplete='off'>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
const s = document.getElementById('search');
|
const s = document.getElementById('search');
|
||||||
document.getElementById('sform').addEventListener('submit', (e) => {
|
document.getElementById('sform').addEventListener('submit', (e) => {
|
||||||
let term = s.value;
|
let term = s.value;
|
||||||
if (/^[^\s]+\.(com|net|org|ca|us|io|cr|gov)(\/[^\s]*)?$/.test(term)) {
|
if (/^[^\s]+\.(com|net|org|ca|us|io|ai|cr|gov)(\/[^\s]*)?$/.test(term)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!/^https?:\/\//.test(term)) {
|
if (!/^https?:\/\//.test(term)) {
|
||||||
term = 'https://' + term;
|
term = 'https://' + term;
|
||||||
|
|
Reference in New Issue