使编号的下拉菜单值与按钮对应? (JavaScript)的

时间:2015-07-03 18:14:07

标签: javascript button

我已经成功编写了一个按钮,该按钮使用数组中的值来生成随机结果。但是现在我需要在上面的下拉菜单中选择任何值来与按钮及其onClick功能相对应。

理想情况下,整个事情看起来像这样:

有多少新兵? [下拉菜单从1到150] 得到新兵! [按钮] (在按下按钮时,您将获得一些新兵等于在下拉菜单中选择的任何值。

我已经在这方面工作了好几天,甚至和其他人谈过这个问题,但他们都说过#34;只是使用PHP。"我想在这里给Javascript一个最后一个镜头(因为,即使它们相似,我也不想为这个项目学习一种全新的语言)。

你的帮助不会受到重视!

    <!DOCTYPE html>
    <html lang ="en">

    <!--


    Author's Name
    Current Date
    Name of Site and Page

    Other necessary comments or notes.


    -->

     <head>

     <script>

        var recruit_dropdown = 0 ;
        var morale = 3 ;
        var discipline = 3 ;
        var skill = 1 ;


      function postmessage() {
       var firstnames = ["John", "Jacob", "Eric", "Conroy", "Vincent",     "Laurence", "Jack", "Harry", "Richard", "Michael", "Kevin", "Daniel", "Cody",     "Brody", "Chase", "Cash", "Norman", "Trevor", "Todd", "Ellis", "Quentin", "Zachary", "Bruce", "Sam", "Horace", "George", "Tom", "Tim", "Wallace", "Walter", "Alex", "Alan", "Sean", "Seamus", "Dudley", "Duke", "Damian", "Nash", "Horton", "Robert", "Mitchell", "Ronald", "Ranald", "Donald", "Dick", "Louis", "Charles", "Ezekiel", "Colin", "Collin", "Victor", "Gerald", "Gerard", "Jann", "Hans", "Fritz", "Peter", "Jessie", "Hector", "Homer", "Bob", "Bobby", "Bill", "Duncan", "Dougan", "Ceric", "William", "Xavier", "Hannes", "Theo", "Theobald", "Leo", "Leonard", "Noah", "Liam", "Mason", "Ethan", "Logan", "Aidan", "Benjamin", "Matthew", "Lance", "Lucas", "Luke", "Joseph", "Gabriel", "Gabe", "Gordon", "Joseph", "Stephen", "Steve", "Anthony", "Andrew", "Samuel", "Carter", "Joshua", "Isaac", "Oliver", "Ollifer", "Olly", "Sebastian", "Caleb", "Owen", "Nathan", "Wyatt", "Hunter", "Dylan", "Christopher", "Christian", "Crispin", "Landon", "Jaxon", "Julian", "Jules", "Ryan", "Henry", "Jonathan", "Aaron", "Isaiah", "Thomas", "Jordan", "Conner", "Evan", "Adrian", "Jeremiah", "Eli", "Cameron", "Braydon", "Constantine", "Gavin", "Conor", "Colton", "Angel", "Grayson", "Lance", "Josiah", "Dominic", "Donny", "Ayden", "Tyler", "Parker", "Ian", "Jose", "Ike", "Mitchie", "Mickey", "Mick", "Nolan", "Noland", "Lincoln", "Bentley", "Jayden", "Kayden", "Carson", "Asher", "Nathaniel", "Ryder", "Justin", "Elias", "Camden", "Jase", "Luis", "Jace", "Tristan", "Trist", "Maxwell", "Miles", "Mateo", "Micah", "Damion", "Damios", "Lanse", "Max", "Ronnic", "Roy", "Ronnie", "Ron", "Cole", "Carlos", "Sawyer", "Cutter", "Kaiden", "Braxton", "Bryce", "Ivan", "Wesley", "Axel", "Kaleb", "Ryker", "Rykard", "Ricard", "Joel", "Grant", "Preston", "Bryan", "Bryab", "Briab", "Bryab", "Briar", "Jacques", "Jaqs", "Jaq", "Jag", "Ashton", "Hayden", "Hunt", "Hant", "Patrick", "Marcus", "Aljehandro", "Edward", "King", "Maddox", "Payton", "Emmanuel", "Mannie", "Bennett", "Everett", "Evon", "Brion", "Brian", "Kaden", "Kadyn", "Riley", "Kai", "Kyle", "Stanley", "Stan", "Calvin", "Luca", "Zayden", "Zay", "Mark", "Jake", "Maximus", "Maximillion", "Kenneth", "Ken", "Nicolas", "Paul", "Dereck", "Deric", "Derick", "Donnie", "Don", "Doniel", "Tanner", "Jax", "Zander", "Jorge", "Francis", "Francois", "Maverick", "Mavin", "Gavin", "Omar", "Atlas", "Orrence", "Orince", "Corbin", "Gage", "Graham", "Grahmn", "Gage", "Caden", "Cayden", "Carter", "Jayceon", "Gael", "Gale", "Gunther", "Butch", "Javier", "Iker", "Elliot", "Lukas", "Gunner", "Garett", "Simon", "Francisco", "Rowan", "Keegan", "Finn", "Judah", "Ricardo", "Paxtin", "Martin", "Paxton", "Jefferey", "Jeffry", "Jeff", "Jeffri", "Jonah", "Erick", "Rick", "Eduardo", "Mack", "Mac", "Dallas", "Romeo", "Tony", "Joey", "Cristian", "Troy", "Shane", "Kameron", "Andy", "Tyson", "Tyler", "Tiler", "Tilyr", "Titus", "Nox", "Theod", "Theon", "Lorry", "Lonny", "Lon", "Lonn", "Knox", "Donovan", "Novan", "Andy", "Emilio", "Cruz", "Cruise", "Rafael", "Holden", "Rivyn", "Riven", "Rivven", "Lane", "Landen", "Jared", "Jonothor", "Reginhard", "Reginald", "Reggie", "Sieghard", "Siegfried", "Zain", "Fritt", "Lumis", "AJ", "Wake", "Elliot", "Archie", "Ron", "Grover", "Fritter", "Frits", "Fritts", "Jordan", "Ozzy", "Jordayne", "Amory", "Amoury", "Blaine", "Jazz", "Moshe", "Tant", "Scott", "Brus", "Devin", "Jean", "Dustin", "Chester", "Ragnar", "Hrodeck", "Harold", "Knut", "Cnut", "Tiernan", "Dwayne", "Kiernan", "Jonny", "Jhonny", "Jhonathan", "Jobeck", "Zeke", "Zatch", "Boris", "Vincenzio", "Ivar", "Grick", "Egil", "Egon", "Egor", "Joffrey", "Guy", "Gui", "Pierre", "Peris", "Pike", "Verik", "Ceric", "Dougan", "Siggurd", "Salver", "Nigel", "Kobe", "Carl", "Karl", "Vynjar", "Homer", "Jasper", "Gerard", "Halvin", "Gared", "Galvin", "Toby", "Gordon", "Gallan", "Flash", "Thorin", "Godric", "Godwin", "Gaspar", "Gaston", "Gary", "Hector", "Ralph", "Boyd", "Zimmer", "Anton", "Walder", "Ned", "Mace", "Grick", "Ashley", "Amber", "Alexis", "Amy", "Anna", "Anatasia", "Aines", "Agnes", "Audrey", "Ava", "Ashara", "Annabelle", "Andrea", "Arissa", "Anara", "Agatha", "Alice", "Becky", "Bethany", "Britney", "Betty", "Belle", "Bella", "Beatrice", "Beatrix", "Bea", "Carol", "Cindy", "Courtney", "Cara", "Candy", "Coraline", "Cera", "Constance", "Coraline", "Corra", "Cecily", "Cherry", "Dina", "Diane", "Darla", "Dixie", "Dalilah", "Danielle", "Dillion", "Defina", "Eva", "Eve", "Eliza", "Elizabeth", "Elena", "Ellia", "Ella", "Esmerelda", "Ellen", "Ebbie", "Eufemia", "Ellise", "Fiona", "Flora", "Fae", "Faith", "Gina", "Gala", "Gilly", "Helen", "Hannah", "Hanna", "Harrah", "Harra", "Hope", "Hayley", "Hillary", "Hannabelle", "Hannabella", "Hera", "Hisha", "Herelda", "Ira", "Iva", "Ivy", "Inga", "Jane", "Jill", "Jasmine", "Judie", "Julia", "Julie", "Josie", "Jodie", "Joan", "Jonella", "Kellie", "Kellen", "Katie", "Lola", "Lila", "Lily", "Lillian", "Lindsey", "Lisa", "Lisha", "Lauren", "Laura", "Lina", "Lana", "Luna", "Libby", "Lexi", "Lynessa", "Lois", "Lizzy", "Milly", "Mellisa", "Mona", "Mipsy", "Maddie", "Maple", "Mabin", "Melvina", "Mildred", "Nina", "Nora", "Nona", "Natasha", "Nancy", "Nancie", "Nimmisa", "Olga", "Onah", "Olenda", "Olenna", "Phoebe", "Patty", "Pita", "Rhonda", "Rheece", "Rita", "Sarah", "Suzy", "Suzie", "Sara", "Sena", "Sasha", "Sylvia", "Sora", "Saphira", "Sophie", "Sofie", "Sophia", "Tracy", "Tracie", "Tammy", "Tilly", "Tammy", "Trixie", "Tiffany", "Tia", "Usina", "Uva", "Unara", "Vixie", "Valerie", "Vanessa", "Victoria", "Vera", "Vicky", "Vina", "Wynafryd", "Wila", "Winny", "Whitney", "Xena", "Zoey" ];
   var firstname = firstnames[Math.floor(Math.random() * firstnames.length)];
   var lastnames = [" Ashton", " Ashberry", " Alltimer", " Antlers", " Acheley", " Ashbury", " Abbey", " Abbot", " Abel", " Abney", " Abraham", " Abrahamson", " Abrams", " Abramsson", " Acker", " Ackerman", " Adari", " Adair", " Adamson", " Adams", " Adkins", " Aikens", " Adsworth", " Ainsworth", " Aiken", " Aitken", " Acker", " Ackerman", " Albert", " Albertson", " Albin", " Albinson", " Alexander", " Allard", " Alfredson", " Alfreds", " Allsopp", " Andrews", " Anderson", " Anders", " Ansel", " Anson", " Appleby", " Archer", " Arkstead", " Atkins", " Arnolds", " Arrington", " Attwater", " Audley", " Augustine", " Auttenberry", " Avery", " Ayers", " Averill", " Ayton", " Auttenberg", " Autumns", " Alfson", " Alvery", " Arking", " Arkins", " Aceling", " Antlers", " Adwyn", " Aquinne", " Axington", " Agronn", " Auring", " Autrunter", " Aprunsy", " Avine", " Ammop", " Addlebraum", " Babcock", " Badcoke", " Bagley", " Baines", " Bayley", " Bernardson", " Bernards", " Benedett", " Baker", " Bottle", " Bigby", " Bolton", " Baldwin", " Bancroft", " Bannister", " Booles", " Banks", " Banner", " Bannerman", " Barber", " Bardsley", " Bainer", " Buckwin", " Buller", " Barnes", " Barnet", " Barett", " Barton", " Bass", " Bates", " Bayton", " Batts", " Baxtor", " Beasley", " Beattie", " Becker", " Beckhett", " Benjamins", " Bickley", " Bickers", " Beaumont", " Blanchett", " Blanche", " Beringer", " Blaise", " Bissette", " Bordelon", " Bouchard", " Bruntley", " Bayer", " Bays", " Butler", " Bunting", " Bottley", " Benson", " Belamy", " Buttons", " Berry", " Beverly", " Byrd", " Bishop", " Blackbourne", " Black", " Benton", " Balke", " Blakeson", " Bloke", " Bloodworth", " Broxham", " Bloxam", " Binion", " Burwick", " Boshley", " Bitner", " Bunker", " Bholder", " Baventer", " Bovving", " Bollivers", " Beyder", " Bewer", " Bastionson", " Buckwell", " Borne", " Baverty", " Blackbull", " Baxter", " Buchanan", " Boone", " Bevvil", " Bolly", " Bixtner", " Blackwood", " Bolvin", " Bonham", " Bonner", " Broxx", " Bradford", " Bowman", " Boyce", " Breckenridge", " Brigham", " Bristol", " Broadbrent", " Bryson", " Burke", " Broadham", " Burns", " Burrell", " Broker", " Brittle", " Brittly", " Bosker", " Boxer", " Buckler", " Bickle", " Bamberg", " Bikner", " Carlyle", " Carman", " Cantrell", " Cannon", " Carver", " Cartmann", " Caulfield", " Causer", " Causey", " Chadwick", " Chasset", " Chamberlain", " Chambers", " Chesire", " Church", " Clay", " Clarkson", " Clayton", " Clemens", " Clifford", " Clentin", " Clentlock", " Clent", " Close", " Cockburn", " Cokes", " Cloutier", " Comtois", " Chastain", " Chevalier", " Cutler", " Colbert", " Collins", " Comb", " Comstock", " Conntley", " Constable", " Cooke", " Cooper", " Culler", " Cinch", " Caverty", " Cornell", " Corra", " Cotterill", " Cowden", " Crawford", " Cross", " Cullen", " Crouch", " Candler", " Cummins", " Curtley", " Chasterly", " Chanter", " Corbray", " Colliver", " Crawford", " Crocking"," Dabney", " Dalton", " Dane", " Danell", " Daniels", " Danielson", " Darby", " Darrell", " Durwell", " Duncanson", " Delacroix", " Darwin", " Devinson", " Doland", " Ditcher", " Dickson", " Deforest", " Diecast", " Dupont", " Dixson", " Evers", " Everson", " Evens", " Enicks", " Everlight", " Egonson", " Egilston", " Ericson", " Errister", " Ergonter", " Ebney", " Ebbers", " Ellonts", " Eastwood", " Eastman", " Eastpacker", " Etner", " Ewers", " Fulton", " Fortunato", " Fuller", " Fixner", " Favours", " Fortune", " Faxton", " Flemming", " Flaverty", " Fillquick", " Filch", " Fontleroy", " Fauxcheux", " Favager", " Favrey", " Faure", " Favreau", " Fournier", " Forestter", " Foss", " Fauste", " Fibber", " Foster", " Fletcher", " Fetcher", " Franklins", " Freyer", " Foote", " Flicke", " Fickle", " Gallant", " Gordonson", " Grande", " Gallop", " Gavelthorpe", " Gustavus", " Gillman", " Giver", " Gust", " Guntherson", " Gaper", " Gricksson", " Givner", " Haftner", " Hjort", " Holgerson", " Hilmarson", " Henrikson", " Haugen", " Hotchkiss", " Hogen", " Heathe", " Hansen", " Hall", " Ikross", " Ingolfson", " Ibsen", " Ingersson", " Johnston", " Jameson", " Johanson", " Jensen", " Jones", " Jakeson", " Jenkins", " Jitters", " Killkner", " Krafter", " Karlson", " Kjeldsen", " Kipper", " Kolby", " Kicker", " Klausen", " Knudson", " Kron", " Lionheart", " Lovett", " Libram", " Leake", " Longman", " Lincoln", " Laker", " Leifson", " Libertus", " Lindberg", " Leonardsson", " Ludvigsson", " Luppin", " Lothbrok", " Littel", " Loomer", " Lovegood", " Lafferty", " Lunaberg", " Londotter", " Lyrams", " Lillybade", " Logans", " Luxberg", " Muller", " Makewell", " Mullendore", " Mixxer", " Morner", " Melbourne", " Mopper", " Nemitz", " Noldan", " Nolandson", " Nomer", " Nixton", " North", " Nailer", " Nickers", " Nahn", " Nohr", " Nilson", " Nacker", " Needey", " Nedson", " Nokker", " Nerty", " Nescker", " Nuquill", " Nazz", " Nuppin", " Nolander", " Nevers", " Nohb", " Ottle", " Oldmann", " Olafson", " Oak", " Oatman", " Ovenstone", " Overton", " Osario", " Opender", " Oddley", " Owens", " Omens", " Oracle", " Ozz", " Ossinder", " Osborne", " Puller", " Pfizer", " Piltner", " Packer", " Poseur", " Pillman", " Paver", " Paxter", " Pitcher", " Pickney", " Picketton", " Paster", " Pitney", " Pines", " Prescott", " Proctor", " Perwynn", " Payne", " Poshe", " Pyre", " Prick", " Quarterman", " Quilter", " Quinn", " Quick", " Quartzman", " Quail", " Ryan", " Rallant", " Rollander", " Rickardson", " Rivetter", " Rickney", " Raverty", " Ranaldson", " Rykerr", " Riggerman", " Reacher", " Rhodahl", " Rower", " Rester", " Royson", " Ripley", " Rifter", " Rafter", " Rustt", " Roper", " Riddick", " Rastton", " Rouen", " Rosegrower", " Roberts", " Rijitt", " Roamer", " Ruyton", " Razner", " Rohe", " Reeces", " Reinhardt", " Rutger", " Reiter", " Reityer", " Sutcliffe", " Stintson", " Stantson", " Stotch", " Stillman", " Stopper", " Stanric", " Stoland", " Spencer", " Stoickson", " Stark", " Stake", " Simmers", " Simmonson", " Sissinius", " Stohlman", " Stickler", " Stewer", " Sapper", " Sawmann", " Sawyers", " Stipper", " Stackhouse", " Slacksley", " Stern", " Shett", " Shivv", " Spinner", " Spitz", " Spaffer", " Sugsley", " Sluys", " Slugger", " Simpleton", " Savinnce", " Salendo", " Sania", " Siggurdson", " Siwir", " Sodder", " Stageman", " Sissilio", " Summers", " Springs", " Stump", " Seraph", " Singer", " Sandalwine", " Salvenson", " Scrivner", " Topper", " Tinker", " Troute", " Trillby", " Tasker", " Thompson", " Traye", " Trolliver", " Tranke", " Trusty", " Truman", " Tartt", " Tanner", " Tang", " Taft", " Totch", " Trodder", " Treviso", " Ullin", " Vonter", " Villian", " Vixxen", " Viviers", " Villiers", " Vonnegutt", " Vickers", " Viewer", " Vake", " Vitner", " Vindercourt", " Valliance", " Wylde", " Wibley", " Wonders", " Wicker", " Wynafryds", " Wilder", " Wollander", " Wincher", " Wallaby", " Wann", " Wittle", " Witcher", " Williamson", " Welder", " Westlander", " Winters", " Wiseman", " Williker", " Woolter", " Wivner", " Wipple", " Werton", " Wordsworth", " Wintercane", " Wulquix", " Wigg", " Willums", " Willows", " Webber", " Winger", " Wiqquer", " Wadd", " Wooler", " Welsh", " Walsh", " Welcher", " Welch", " Xavianos", " Yarwick", " Yolander", " Yilstringer", " Yeller", " Zieglar", " Zimmerman", " Zapp", " Zanderson" ];
   var lastname = lastnames[Math.floor(Math.random() * lastnames.length) ];
   var ages = [", age 16.", ", age 17.", ", age 18.", ", age 19.", ", age 20.", ", age 21.", ", age 22.", ", age 23.", ", age 24.", ", age 25.", ", age 26.", ", age 27.", ", age 28.", ", age 29.", ", age 30.", ", age 31.", ", age 32.", ", age 33.", ", age 34.", ", age 35." ] ;
   var age = ages[Math.floor(Math.random() * ages.length) ];
   var personalities = [" They have a Cruel personality (-1 Discipline, +1 Morale, increased chance for infighting).", " They have an Arrogant personality (-2 Discipline, +1 Morale).", " They have an Arrogant personality (-2 Discipline, +1 Morale).", " They have an Arrogant personality (-2 Discipline, +1 Morale).", " They have an Aloof personality (No effect).", " They have an Aloof personality (No effect).", " They have an Aloof personality (No effect).", " They have a Melancholic personality (-1 Morale, will never engage in infighting).", " They have a Melancholic personality (-1 Morale, will never engage in infighting).", " They have a Meek personality (-1 Morale, +1 Discipline, increased chance of being victim of infighting).", " They have a Meek personality (-1 Morale, +1 Discipline, increased chance of being victim of infighting).", " They have a Rowdy personality (+1 Morale, -2 Discipline).", " They have a Rowdy personality (+1 Morale, -2 Discipline).", " They have an Insane personality (-3 Discipline, Unpredictable)." ] ;
   var personality = personalities[Math.floor(Math.random() * personalities.length) ];
   document.getElementById("recruit1").textContent = "Your new recruit is Pvt. " + firstname + lastname + age + personality ;

}
   function postmorale() {
   document.getElementById("recruit2").textContent = "Morale: " + morale ;
   } 
   function postdiscipline() {
   document.getElementById("recruit3").textContent = "Discipline: " + discipline ;
   }
   function postskill() {
   document.getElementById("recruit4").textContent = "Skill: " + skill ;
   }

  </script>

  <title>TitleOfSite</title>
  <meta charset = "utf-8" >
  <link rel="stylesheet" href="whatever-your-stylesheet-is-named.css">
  <link rel="shortcut icon" href="whatever-your-site's-icon-is-named.ico" type="image/x-icon"/>

  <!-- [if lt IE 9 ]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
  <![endif]-->
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

 </head>

 <body>
  <form>
          <legend>Get</legend>
             <select id = "dropdown">
               <option value = "1">1</option>
               <option value = "2">2</option>
               <option value = "3">3</option>
               <option value = "4">4</option>
               <option value = "5">5</option>
               <option value = "6">6</option>
               <option value = "7">7</option>
               <option value = "8">8</option>
               <option value = "9">9</option>
               <option value = "10">10</option>
               <option value = "11">11</option>
               <option value = "12">12</option>
               <option value = "13">13</option>
               <option value = "14">14</option>
               <option value = "15">15</option>
               <option value = "16">16</option>
               <option value = "17">17</option>
               <option value = "18">18</option>
               <option value = "19">19</option>
               <option value = "20">20</option>
               <option value = "21">21</option>
               <option value = "22">22</option>
               <option value = "23">23</option>
               <option value = "24">24</option>
               <option value = "25">25</option>
               <option value = "26">26</option>
               <option value = "27">27</option>
               <option value = "28">28</option>
               <option value = "29">29</option>
               <option value = "30">30</option>
               <option value = "31">31</option>
               <option value = "32">32</option>
               <option value = "33">33</option>
               <option value = "34">34</option>
               <option value = "35">35</option>
               <option value = "36">36</option>
               <option value = "37">37</option>
               <option value = "38">38</option>
               <option value = "39">39</option>
               <option value = "40">40</option>
               <option value = "41">41</option>
               <option value = "42">42</option>
               <option value = "43">43</option>
               <option value = "44">44</option>
               <option value = "45">45</option>
               <option value = "46">46</option>
               <option value = "47">47</option>
               <option value = "48">48</option>
               <option value = "49">49</option>
               <option value = "50">50</option>
               <option value = "51">51</option>
               <option value = "52">52</option>
               <option value = "53">53</option>
               <option value = "54">54</option>
               <option value = "55">55</option>
               <option value = "56">56</option>
               <option value = "57">57</option>
               <option value = "58">58</option>
               <option value = "59">59</option>
               <option value = "60">60</option>
               <option value = "61">61</option>
               <option value = "62">62</option>
               <option value = "63">63</option>
               <option value = "64">64</option>
               <option value = "65">65</option>
               <option value = "66">66</option>
               <option value = "67">67</option>
               <option value = "68">68</option>
               <option value = "69">69</option>
               <option value = "70">70</option>
               <option value = "71">71</option>
               <option value = "72">72</option>
               <option value = "73">73</option>
               <option value = "74">74</option>
               <option value = "75">75</option>
               <option value = "76">76</option>
               <option value = "77">77</option>
               <option value = "78">78</option>
               <option value = "79">79</option>
               <option value = "80">80</option>
               <option value = "81">81</option>
               <option value = "82">82</option>
               <option value = "83">83</option>
               <option value = "84">84</option>
               <option value = "85">85</option>
               <option value = "86">86</option>
               <option value = "87">87</option>
               <option value = "88">88</option>
               <option value = "89">89</option>
               <option value = "90">90</option>
               <option value = "91">91</option>
               <option value = "92">92</option>
               <option value = "93">93</option>
               <option value = "94">94</option>
               <option value = "95">95</option>
               <option value = "96">96</option>
               <option value = "97">97</option>
               <option value = "98">98</option>
               <option value = "99">99</option>
               <option value = "100">100</option>
               <option value = "101">101</option>
               <option value = "102">102</option>
               <option value = "102">102</option>
               <option value = "103">103</option>
               <option value = "104">104</option>
               <option value = "105">105</option>
               <option value = "106">106</option>
               <option value = "107">107</option>
               <option value = "108">108</option>
               <option value = "109">109</option>
               <option value = "110">110</option>
               <option value = "111">111</option>
               <option value = "112">112</option>
               <option value = "113">113</option>
               <option value = "114">114</option>
               <option value = "115">115</option>
               <option value = "116">116</option>
               <option value = "117">117</option>
               <option value = "118">118</option>
               <option value = "119">119</option>
               <option value = "120">120</option>
               <option value = "121">121</option>
               <option value = "122">122</option>
               <option value = "123">123</option>
               <option value = "124">124</option>
               <option value = "125">125</option>
               <option value = "126">126</option>
               <option value = "127">127</option>
               <option value = "128">128</option>
               <option value = "129">129</option>
               <option value = "130">130</option>
               <option value = "131">131</option>
               <option value = "132">132</option>
               <option value = "133">133</option>
               <option value = "134">134</option>
               <option value = "135">135</option>
               <option value = "136">136</option>
               <option value = "137">137</option>
               <option value = "138">138</option>
               <option value = "139">139</option>
               <option value = "140">140</option>
               <option value = "141">141</option>
               <option value = "142">142</option>
               <option value = "143">143</option>
               <option value = "144">144</option>
               <option value = "145">145</option>
               <option value = "146">146</option>
               <option value = "147">147</option>
               <option value = "148">148</option>
               <option value = "149">149</option>
               <option value = "150">150</option>
             </select>
    </form>
  <input type="button" value="Get Recruit" onclick="postmessage(); postmorale(); postdiscipline(); postskill();" />
  <div id="recruit1"></div>
  <div id="recruit2"></div>
  <div id="recruit3"></div>
  <div id="recruit4"></div>
 </body>

</html>

1 个答案:

答案 0 :(得分:0)

你不需要PHP ......事实上,这完全是错误的计算机(主机,而不是客户机)。

您需要做的是将事件附加到列表的 onChange 事件中。值更改时,检索该值。然后,将点击 - 事件发布到该按钮,它将作出反应,就像伪点击来自浏览器一样。