I'm Highmax and I'm an idiot.
<insert everyone Hi max, then laughing because they got the joke>
I'm trying to work on my Javascript assignment, and I have to write a program that creates a form that has three radio buttons that allow you to pick a flower type and then have a single text box and the program spits out the form with your name, flower choice and a thank you note on it. Well, as I said, I'm an idiot and I can't understand the damn textbook when it comes to this. I seriously don't know whats supposed to be calling or executing what because 99% of these, from what I see, is calling random names and pulling it out of its arse at random times.
Seriously though, I don't know why its not working when I've done everything I THINK is right (and we all know that since I have no idea what I'm doing, assume I'm wrong somewhere). Here's the code
<html>
<head>
<!-- Program Name: flowerForm.html
Purpose: To create a form with the user's name and a choice of flower
Author: Specner Durette
Date last modified: February 3rd, 2015
-->
<script type="text/javascript">
//Variables
var flower;
var BR = "<br />";
var PA = "<p />";
var NL = "\n";
//Change the flower value when a radio button is pressed
function setType(flowerType) {
flower=flowerType;
}
function displayRequest() {
var fullName = document.FlowerForm.fullName.value;
var flower = document.FlowerForm.flowerPicked.value;
document.FlowerForm.FormRequest.value =
"Thank you for requesting information!" + NL + NL
+ "Name: " + fullName + NL
+ "Flower Inquiry About: " + flowerType
}
</script>
</head>
<body>
<h2>Flower Information Form</h2>
<form name="FlowerForm" action="">
<strong>Enter Your Full Name:</strong><br />
<input type="text" name="fullName" value="Full Name" size="40"><br />
<br />
<strong>Select the flower you wish to make an inquiry about</strong><br />
<input type="radio" name="flower" value="Roses" onclick="setType(flowerType)" />Roses<br />
<input type="radio" name="flower" value="Carnations" onclick="setType(flowerType)" />Carnations<br />
<input type="radio" name="flower" value="Daisies" onclick="setType(flowerType)" />Dasies<br />
<input type="button" name="resquestButton" value = "Display Request" onclick="displayRequest()" /><p />
<textarea name ="FormRequest" readonly="true" value = "" rows="8" cols="50"></textarea><br />
</form>
</body>
</html>
For reference, its Case 3-4/3-5 in the textbook Principles of Program Design: Solving Problems with JavaScript by Paul Addison