As a newbie I'm trying to make a very simple email form work, but after hours and hours of lurking I still can't resolve it.
The problem is that firefox refuses to submit the form correctly while also clearing it, yet this works fine in Chrome and IE.
At the moment the code submits in all browsers, but doesnt clear in any of them. If I remove the "action" parameter
from the GetElementById it will submit and clear in Chrome / IE but not in Firefox.
Why are you calling submit() when it's going to be called automatically?
The moment you submit a form, the browser starts to load the 'action' url and there's no guarantee regarding what can or cannot happen subsequently on the current page.
If you want to submit form values without navigating to a new page, you can use an AJAX request, but the process will be script-dependent.
Where used, return should be executed unconditionally and always as the last statement in the function.
That's my signature, it's not part of the damn post!
Well that clears fields fine in both browsers but it won't submit correctly in any for some reason ! =) Is there a way to also within the form call a seperate function that will use submit(action) etc? Maybe some onSubmit?
Thanks, but I'm sorry, just doesn't go through ...My script just doesn't let me submit the form correctly unless I use the onClick evenhandler, and if I do I still cant make Firefox clear the form after submission. I'm still lost..