JSFiddle - React, Tailwind, and code Playground

by Twisty

HTML

<form action="/echo/json" method="post">
  <select name="timeEnabled" onchange="timeUpdated()" class="alignLeft nowrap">
    <option value="true" selected="selected">Yes</option>
    <option value="false">No</option>
  </select>

  <input name="submit" value="Apply" onclick="return preSubmit()" class="btn btn-small btn-primary" type="submit">
</form>

JavaScript

// ==UserScript==
// @name        Apply Each Tab
// @date				01/27/2016
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @namespace   http://www.your-url-target.com/page-target.html
// @description Select a value from an element and submit the parent form.
// @version     0.1
// @grant       none
// ==/UserScript==

$(document).ready(function() {
  $("form").submit(function() {
    console.log($("select[name='timeEnabled']").val(), "selected. Form submitted.");
  });
  $("select[name='timeEnabled']").val(1);
  $("input[type='submit']")[0].click();
});