/    Sign up×
Community /Pin to ProfileBookmark

im doing a project for a class in school and i need hbelp on the email check, xipcode check, the radio button and phone PLEASE help me out here is my little project so far:

<html>
<title>Buy-a-Penguin.com</title>
<head>
<center><h2>
Welcome to Buy-a-Penguin.com, Please fill out the form below <br>to get started on adopting your own penguin!
<br><br><BR>
</head>
<body bgcolor=”white”>
<form method=”post” action=”mailto:[email protected]” enctype=”text/plain” onSubmit=”CheckZip” name=”myform”>
<table border=”4″>
<td>
First Name:<input name=”Fname” type=”text” size=”10″ maxlength=”10″><br>
Last Name:<input name=”Lname” type=”text” size=”10″ maxlength=”10″><br>
</td>
<td>

Street Address:<input name=”Adress” type=”text” size=”20″ maxlength=”20″><br>

</td>
<td>
Home Phone Number<input name=”Phone Number” type=”text” size=”12″ maxlength=”12″><br>
(ex: xxx-xxx-xxxx)

</td>
<td>

</td>

</tr>
<tr>

<td>
Zip Code<input name=”Zip Code” type=”text” size=”10″ maxlength=”10″><br>

</td>
<td>
Country<input name=”Country” type=”text” size=”10″ maxlength=”10″><br>

</td>
<td>
Pick a color for your new Penguin
<select name=”Color”>
<option>Please Pick A Color </option>
<option>Green </option>
<option>Yellow</option>
<option>Pink</option>
<option>White</option>
<option>Orange</option>
<option>Red</option>
<option>Brown</option>
<option>Blue</option>
<option>Normal(Black and White)</option>
</td>
<tr>
<td>
<align=”center”>What eles would you want with your order?<br>
<input type=”checkbox” name=”1″ value=”interest1″>Internet
<br>
<input type=”checkbox”name=”2″ value=”intest2″>Fish(1lb=$9.99)
<br>
<input type=”checkbox” name=”3″ value=”interest3″>Inground water temp pool(1gl=$29.99)
<br>
<input type=”checkbox”name=”4″ value=”other”>Slide into pool($79.99)
</td>
<td>
<center>
What gender do you want your penguin to be?:
<br>
<input type=”radio” name=”radio1″ value=”Radio” onClick=”0″>Male
<input type=”radio” name=”radio1″ value=”Television” onClick=”0″>Female
</td>
<td>
fghdfhgdfghdfgh
</td>
</tr>
</table>
<script>
function isCharNumeric(passedVal) {
if (passedVal < “0”) {return false;}
if (passedVal > “9”) {return false;}
return true;
}
function isStringNumeric(passedVal) {
for (i=1; i < 3; i++) {
if (!isCharNumeric(passedVal.charAt(i))) return false;
}
for (i=5; i < 7; i++) {
if (!isCharNumeric(passedVal.charAt(i))) return false;
}
for (i=9; i < passedVal.length; i++) {
if (!isCharNumeric(passedVal.charAt(i))) return false;
}
return true;
}
function validphone(Phone Number) {
if ((Phone Number == “”)||( Phone Number.length != 12)) {return false;}
if (isStringNumeric(Phone Number)) {

return true;
}
return false;
}
function submitIt(form) {
if (!validphone(form.phone.value)) {
alert(“That is an invalid Phone Number”)
form.phone.focus()
return false;
}
return true;
}
</script>

<input type=”submit” value=”Submit” onSubmit=submitIt(form)>
</form>
</body>
</html>

Can you please make it work so far and add the email check, zipcode, phone number, and checkbox! PLEASE PLEASE PLEASE! i have no idea of what to do?!?!??!?!??!?!?!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@ImOnFireauthorJan 05.2007 — Any Help will be VERY, VERY appreciative!
Copy linkTweet thisAlerts:
@disgracianJan 05.2007 — Your HTML needs a lot of fixing before we even get to the Javascript component. I don't mean to sound condescending, but you should really read up on a few tutorials on how to make HTML forms because there are just so many errors. This [url=http://www.javascript-coder.com/html-form/html-form-tutorial-p2.phtml]form tutorial[/url] looks pretty good and comprehensive from the glance I took at the first few pages. One example of what I'm talking about is the following:&lt;td&gt;What gender do you want your penguin to be?:&lt;br&gt;
&lt;input type="radio" name="radio1" value="Radio" onClick="0"&gt;Male
&lt;input type="radio" name="radio1" value="Television" onClick="0"&gt;Female
&lt;/td&gt;
Why is the value of the Male button "Radio", and the value of Female "Television"? This tells me that you've just copied this from somewhere else without knowing what it does. Your form also calls a function that doesn't exist.

Cheers,

D.
×

Success!

Help @ImOnFire spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...