Oh. I knew about the space, I just put it there so on the post you could tell the differece between two ' and ". I got it working anyway, actually. I have one more issue concerning form submission, though.
Code:
function submitForm(){
var name = document.getElementById ('name');
document.write('Name:' + name);
}
I'm guessing your page goes blank and only displays the name object?
Are you trying to validate the name field here? (name.value)
document.write clears the entire page if you call it when the page is finished loading. Try alert instead to check the value.
Also you are not returning a true/false value from submitForm() ;
And you are not returning the results of submitForm() to the actual form: onsubmit="return submitForm();"
What happens in Google Chrome is...nothing, except the address bar adds on a ?name=John&email=myname@domain.com, ect. In Firefox you see a Name: and either blank space or the word null.
Bookmarks