Hi, I am taking a class in ‘web programming’. I am 35 woman, and I’m in a team of 22 year olds. We have a project with javascript, obviously. I find searching the internet for help to be a bit overwhelming. I will post individual segments of the project that I have done… most of it is still just html, but we’re supposed to use functions, etc, to make it do stuff. Trying to copy from what we learned in class isn’t working out.
First, the submit button with the command to validate an email address:
<input type=’button’ value=’submit’ onclick=’validate()’
<script>
function validate(){
email=document.biostuff.email.value;
posAt=emailindexof(“@”);
if (posAt==-1){
alert(‘Bad email’);
return;
};
</script>
so I have the function
email=document.biostuff.email.value;
I used:
<input type=hidden…. tags to name the profile form not ‘document’.
So not only do I need help with the function itself, I need to know how I was supposed name the form so that my javascript finds it.
Oh in addition…. I would like someone to explain the ‘alert’ command. In class we used it in html with the input tag and now it’s here in the javascript. Let me know if that also needs corrected.
One more question about this example, is where do I place it in the textfile? In the form, before the form, by the submit button?
Thank you. I will be posting more questions in this thread.