hello all,
i have the following code that has a textarea on the form and also 3 input text box’s i need to either expand the last (3rd) input text field to be a text area or have a function that checks for at least one charactor in the textare i have been having no luck simple expanding the 3rd input box to a textare
help thanks john
<html>
<head>
<script type=”text/javascript”>
function validate()
{
x=document.myForm
at=x.email.value.indexOf(“@”)
code=x.code.value
firstname=x.fname.value
submitOK=”True”
if (at==-1)
{
alert(“Not a valid e-mail!”)
submitOK=”False”
}
if (firstname.length<1)
{
alert(“Please…Your name must be at least 1 charactor long”)
submitOK=”False”
}
if (code.length<1)
{
alert(“Please enter a comment”)
submitOK=”False”
}
if (submitOK==”False”)
{
return false
}
}
</script>
</head>
<body>
<form name=”myForm” action=”hello.htm” onsubmit=”return validate()”>
<br>
I have a bike:
<input type=”checkbox” name=”Bike”>
<br>
I have a car:
<input type=”checkbox” name=”Car”>
<p></p>
Male:
<input type=”radio” checked=”checked”
name=”Sex” value=”male”>
<br>
Female:
<input type=”radio”
name=”Sex” value=”female”>
<p></p>
<select name=”cars”>
<option value=”volvo”>Volvo
<option value=”saab”>Saab
<option value=”fiat”>Fiat
<option value=”audi”>Audi
</select>
<p></p>
<textarea rows=”10″ cols=”30″>
Please enter a few coments.
</textarea>
<p></p>
Enter your e-mail: <input type=”text” name=”email” size=”20″><br />
Enter your name: <input type=”text” name=”fname” size=”20″><br />
Enter a comment: <input type=”text” name=”code” size=”20″><br />
<input type=”submit” value=”Submit”>
</form>
</body>
</html>