I'm learning HTML, CSS and Javascript at the moment. Most of my education is coming from W3Schools website, who seem to focus more on the how, instead of the why. But one thing their HTML course hasn't taught me is how to create forms properly.... I put a poll down the side of my index page with radio buttons. Now when I test this out, it's possible to select ALL of the buttons, which is obviously pointless. And on top of that, how can I actually gather data from the form? It doesn't seem like I can do this with Javascript, from the overview I have of it so far....do I need a server-side language?
Firstly, http://w3fools.com/ A basic form is like this, Code: <form> 1 <input type="text" name="1" /> 2 <input type="text" name="2" /> </form> For a poll, <input type="checkbox" can be used and also <input type="radio"
If you want to gather data for future and wants to store it in database then surely you need to do programming in language like php, c# etc.
Interesting review on W3Schools, lol. I've ordered a book from Amazon on PHP, JS and mySQL. I know how to display a form for the poll, I know how to make the page do something when the button is pressed. But I want the information to go somewhere. Do I really need to learn something as complex as C# when I am this close to the beginning? PHP is so good because it's relatively simple, by all accounts.
By 'go somewhere' do you mean collect it? Like in a database? You don't need C# right now, PHP and MySQL will do the job. If you want to work with PHP download XAMPP, and look at some tutorials. Code: $first_Name = strip_tags(@$_POST['article_name']); $last_Name = strip_tags(@$_POST['article_Lname']); $username = strip_tags(@$_POST['article_userName']); $email = strip_tags(@$_POST['article_email']); $password = strip_tags(@$_POST['article_password']); $passwordrepeat = strip_tags(@$_POST['article_passwordR']); $age = strip_tags(@$_POST['article_age']); $language = @$_POST['article_lang']; $country = @$_POST['article_country']; $gender = @$_POST['article_gender']; $connect = mysql_connect("localhost", "root", ""); mysql_select_db("registeruser"); $reg = mysql_query ("INSERT INTO register SET id = '', first_Name = '$first_Name', last_Name = '$last_Name', Username = '$username', email_Address = '$email', Password = '$password', birth_Year = '$age', language = '$language', country = '$country', gender = '$gender' "); This is from the website I was working on a few days back. This will connect to the MySQL database, and then 'record' the data that is inputted by the user. This is the HTML that goes with it. Code: <article id="article_norm"><br /> <img src="RegisterHD.png" id="article_RegisterHD" /> <form action="register.php" method="POST"> <div id="article_labelInput"> <h3 id="artical_detHe">Register Information</h3><br /> <label for="article_name" class="article_name">First Name </label> <input type="text" id="article_name" name="article_name" maxlength="14" title="First Name"/><br /> <label for="article_Lname" class="article_Lname">Last Name </label> <input type="text" id="article_Lname" name="article_Lname" maxlength="14" title="Last Name"/><br /> <label for="article_userName" class="article_userName">Username </label> <input type="text" id="article_userName" name="article_userName" maxlength="12" title="Username"/><br /> <label for="article_email" class="article_email">Email Add.</label> <input type="text" id="article_email" name="article_email" maxlength="32" title="Email Address"/><br /> <label for="article_password" class="article_password">Password </label> <input type="password" id="article_password" name="article_password" title="Password"/><br /> <label for="article_passwordR" class="article_passwordR">Password </label> <input type="password" id="article_passwordR" name="article_passwordR" title="Re-Enter Password" /><br /> <label for="article_age" class="article_age">Birth Year </label> <input type="text" id="article_age" name="article_age" maxlength="4" title="Age"/><br /> <label for="article_lang" class="article_lang">Language </label> <select id="article_lang" name="article_lang" title="Language"> <option value="">Select One</option> <option value="en">English</option> <option value="it">Italian</option> <option value="sp">Spanish</option> </select><br /> <label for="article_country" class="article_country">Country </label> <select id="article_country" name="article_country" title="Country"> <option value="">Select One</option> <option value="en">United States</option> <option value="ca">Canada</option> <option value="uk">United Kingdom</option> <option value="as">Australia</option> <option value="it">Italy</option> <option value="ot">Other</option> </select><br /> <label for="article_gender" class="article_gender">Gender </label> <select id="article_gender" name="article_gender" title="Gender"> <option value="">Select One</option> <option value="mal">Male</option> <option value="fem">Female</option> </select><br /> <center><input type="Submit" id="article_submit" name="article_submit" value=" Register " title="Register" /></center> </div> </form> This is merely just showing an example of what is needed. Like Solidus said, "For a poll, <input type="checkbox" can be used and also <input type="radio"", just use that for your poll. Hope this helped you figure out what will be needed.