Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- 'use strict';
- function checkValue() {
- let schoolNames = new Set();
- let list = document.getElementById("variants");
- for (let i = 0; i < list.options.length; i++)
- schoolNames.add(list.options[i].value);
- if (!schoolNames.has(document.getElementById('entry_286499743').value)) {
- document.getElementById("message").innerHTML = "Incorrect value";
- return false;
- }
- document.getElementById("message").innerHTML = "";
- return true;
- }
- function main() {
- let field = document.getElementById("entry_286499743");
- field.addEventListener('change', checkValue);
- }
- window.onload = main;
- </script>
- <form action="https://docs.google.com/forms/d/e/1FAIpQLSdEg24X_TORjtj3XdWDHKuGgydtaFcj-jz8BvKx5j3eaOWYQA/formResponse" method="POST" id="ss-form" target="_self" onsubmit="return checkValue()">
- <input type="text" name="entry.286499743" value="" class="ss-q-short" id="entry_286499743" dir="auto" aria-label="Asdf " title="", list="variants">
- <label type="text" id="message"></label>
- <input type="hidden" name="draftResponse" value="[,,"-1546189611401698003"]
- ">
- <input type="hidden" name="pageHistory" value="0">
- <input type="hidden" name="fbzx" value="-1546189611401698003">
- <input type="submit" name="submit" value="Готово" id="ss-submit">
- </form>
- <datalist id="variants">
- <option>asdf</option>
- <option>sddasdf</option>
- <option>kjasdf;ljasdf;lk</option>
- </datalist>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement