Okay here is the deal. Im a JR in college and my major is information science. Im new to all this programming stuff and Ive been confused since day one. THe proff is the worst ive ever had and doesn't explain anything as the class already knows and most people havnt even started anything.

On with the question. I just don't get how to use Visual Basic. Im used to dreamweaver and ive tryed looking stuff up online but nothing seems to get into my head as far as understanding. The book im using is called database driven websites.

Here is what I have to do:

I have all these files to use and I need to use them for this. I need to open up workorders.htm and ad a script so it contains a data validation function. The data validation function should cingirm that the user enters values for the work order id, date, and VIN. It shoudl validate that the workorder ID is a number, and that the work order date has a valid date format. When the script detects an error in a text input, set the focus to the text imput and highlight it's contents.

After the script validates the date values, display all the imput values in a congirm message. If the user clicks OK on the confirm message, submit the values to the web server. If the user clicks cancel, redisplay the work order webpage.


Now so far I think think I did this. This is the first step theres about 5 more things I have do to for this.

If this coding is wrong could someone help out? Thank you!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Al's Body Shop</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">

<script type="text/javascript">

function Empty(elem){
var str = elem.value;
if(str.length == 0){
alert("You must fill in all required fields");
return true;
} else {
return false;
}
}

function formValidation(form){

var torf = 0;

if(Empty(form.txtWOID)){
torf = 1;
form.txtWOID.focus();
}

if(torf == 0)
if(Empty(form.txtVIN)){
torf = 1;
form.txtVIN.focus();
}

if(torf == 0)
if(Empty(form.txtWODate)){
torf = 1;
form.txtWODate.focus();
}


if(torf == 1)
return false;
else {
torif = confirm("Work order ID = " + form.txtWOID.value + "\n VIN = " + form.txtVIN.value + "\n Date = " + form.txtWODate.value);

if(torif == 1)
return true;
else
return false;
}

}
</script>
</head>
<body>
<form name="frmOrder" onSubmit="return formValidation(this)">
<table align=center width=377 height=121>
<tr><td><img src="car.jpg" height=115 width=136></td><td><h1 align=center>Work Orders</h1></td></tr>

</table>
<p>
<table border align=center>
<tr><td>Work Order ID: <input type=text name=txtWOID size=6></td>
<td>VIN:&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <input type=text name=txtVIN size=30></td></tr>
<tr><td>Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp; <input type=text name=txtWODate size=10></td>

<td>Service:&nbsp; &nbsp;<select name=lstService size=1>
<option selected>Oil Change</option>
<option>Rotate Tires</option>
<option>Radiator Service</option>
<option>Car Wash</option>
<option>Lube Chassis</option>
</select></td></tr>

<tr><td>
Paid?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ; <input type=checkbox name="chkPaid" value="PAID"<td>
<td align=middle><input type=submit value="Submit"></td></tr>

</table>
</form>
</p>
<h4><a href="als.htm">Return to Home</a></h4>

</body>

</html>