I'm trying to create a a basic form I guess you could say.

1. Text area: user writes whatever the hell he wants.
2. Search 'textfield': let's say the user puts in the letter 'a'
3. results 'textfield': tells the user how many times the letter 'a' appears.

4. search button.
5. reset button.

I don't quite seem to understand the onclick code, or how to approach this one in general...here is what I have so far. I have a feeling this is all wrong, but I'm gonna keep workin at it until I get a reply from a more experienced poster on here.

function copyText (){
document.myForm.mySearchFor.value=
document.myForm.mySearchFor.value;

document.myForm.mySearchIn.value=
document.myForm.mySearchIn.value;
}

function myResults ()

while (document.myForm.mySearchFor.value == document.myForm.mySearchIn.value)
{
document.myForm.myResults.value + 1;
}

function myButton (){
onclick=