you can't really convert it - it's a different langugage - here are some examples that I've conjured up. You can study them and use them if you like, or search elsewhere. There are a lot of samples on the web, and also here at tek-tips:
Here's something simple:
<script language="JavaScript">
function ValidateForm()
{
if (document.frmQuickQuote.txtSchoolName.value ==""

{
alert("Please enter a school name."

return false;
document.frmQuickQuote.txtSchoolName.focus()
}
if (document.frmQuickQuote.txtContact.value ==""

{
alert("Please enter a contact name."

return false;
document.frmQuickQuote.txtContact.focus()
}
if (document.frmQuickQuote.txtPhone.value.length<10 | document.frmQuickQuote.txtPhone.value.length>12)
{
alert ("Please check the telephone number you entered. Make sure it has an area code."

return false;
document.frmQuickQuote.txtPhone.focus()
}
}
</SCRIPT>
Here is how the above code is called by the html on the form:
<form action="QuickQuoteProc.asp" method="post" name="frmQuickQuote" onSubmit="return ValidateForm()">
Here's something a little more involved:
function isItDate(elm) {
if (elm.value.length < 10 || elm.value == ""

{
return false;
}
for (var i=0; i < elm.value.length; i++) {
if (i > -1 && i < 10) {
if (elm.value.charAt(2) == "/" || elm.value.charAt(5) == "/"

{
return true;
}
else if (elm.value.charAt(i) < "0" || elm.value.charAt(i) > "9"

{
return false;
}
}
}
}
//this function tests for an empty value in the box it's called on below
function isItEmpty(elm) {
if (elm.value == "" || //the "|" means "OR"
elm.value == "null"

{
return false;
}
}
//This is the main portion of the function - it incorporates all of the other functions
//outlined above and uses them on the text/combo boxes on the form before it is submitted.
function formValidation() {
var currentForm
currentForm=document.frmChangeEvent
if (isItEmpty(currentForm.txtEventName) == false) { //isItEmpty function defined above.
alert("Please enter a Name for this event."

;
currentForm.txtEventName.focus();
return false;
}
else if (isItEmpty(currentForm.txtEventDescrip) == false) { //isItEmpty function defined above.
alert("Please enter a Description for this event."

;
currentForm.txtEventDescrip.focus();
return false;
}
else if (isItDate(currentForm.txtEventDate) == false) {
alert("Please enter a date in the form dd/mm/yyyy."

;
currentForm.txtEventDate.focus();
return false;
}
}
Here's how the above code is called in this case from the form's html
<form method="post" action="EventsChange.asp?formUpdate=true" name=frmChangeEvent onSubmit="return formValidation()">
Good luck. I'd also suggest buying a book. I like Nick Heinle and Bill Pena - Designing with Javascript. Great exapmles. It looks cryptic, but they do a good job of deciphering it. It was 35 bucks.
Ah say, there's somethin' a little "eeeeeeee" 'bout a boy who don't like basbawl...