2 Replies - 794 Views - Last Post: 04 March 2012 - 08:53 PM

#1 sviridovt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 04-March 12

HTML Submit button doesnt work

Posted 04 March 2012 - 08:27 PM

Hello all,

I dont know why this is happening and I tried it locally as well as on my server but the submit button doesnt work for some reason, I tried searching it up and I cant find any solution. Whenever I press the submit button it just doesnt do anything. Here is the code in index.php (I also tried using .html but that doesnt help (even though that shouldnt make a difference)):

<!DOCTYPE html> 
<html>
<body>
<h1>SkyGroup Seat Configuration Generator (SGCG)</h1>
<form method="get" action="calc.php" >
Max Certified Seats: <input name="maxseats" type="text"><br/>
How many classes configuration: <br/>
<select name="classes">
<option>Single (All economy)</option>
<option>Dual (Eco+Business)</option>
<option>3-class (Eco, Business, and First)</option>
</select>
</br>
Target Business Seats: <input name="business" type="text" ></br>
Target First Class Seats: <input name="business" type="text"></form></body></html></br>
*You dont need to select economy class seats as they will be used to fill up the rest of the capacity.</br>
How high quality is your airline? 
<select name="quality">
<option>2 stars</option>
<option>3 stars</option>
<option>4 stars</option>
<option>5 stars</option>
</select>
</br>
<input type="submit" name="submit" Value="Generate!" >
</form>
</body></html>




and here is calc.php (even though I dont think thats the issue)

<?php
//Input Variables Processing

$maxSeats = $_GET["maxseats"];
//$classConfig = $_GET["classes"];
if ($_GET["classes"] == "Single (All economy)") {$classConfig = 1};
elseif ($_GET["classes"] == "Dual (Eco+Business)") {$classConfig = 2};
elseif ($_GET["classes"] == "3-class (Eco, Business, and First)") {$classConfig = 3};
else {echo "Cant Find Class Configuration"};

echo $classConfig;
?>



I didnt finish calc.php because I wanted to test it out to see if the form works.

Thanks, Tim

this is for an online game just FYI :P

Is This A Good Question/Topic? 0
  • +

Replies To: HTML Submit button doesnt work

#2 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: HTML Submit button doesnt work

Posted 04 March 2012 - 08:33 PM

Target First Class Seats: <input name="business" type="text"></form></body></html>
You closed the <form>, <body> and <HTML> tags! Why would you do that?
Was This Post Helpful? 1
  • +
  • -

#3 sviridovt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 04-March 12

Re: HTML Submit button doesnt work

Posted 04 March 2012 - 08:53 PM

View PostDimitriV, on 04 March 2012 - 08:33 PM, said:

Target First Class Seats: <input name="business" type="text"></form></body></html>
You closed the <form>, <body> and <HTML> tags! Why would you do that?


I didnt mean to do that :P its weird how I didnt notice it. Thanks! It works now :P

(I kinda feel like an idiot now :P )
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1