Html form action behavior

Q

question.boy

I created a form

<form id="feedback" name="feedback" method="post" action="cgi-bin/
FormMail.pl" onsubmit="return validate_form(this);">
....

</form>

You get the idea. So basically I need to run some javascript to check
what the user has entered and if everything checks out then send it by
e-mail using FormMail.

This works just fine in IE but not in Firefox. In Firefox, it does
not seem to process the javascript an simply send it to the cgi
regardless of what is entered. Could someone enlighten me as to why
it is disregarding the onclick event? How can I learn about creating
code that is truly universal?

Thank you

QB
 
Q

question.boy

I created a form

<form id="feedback" name="feedback" method="post" action="cgi-bin/
FormMail.pl" onsubmit="return validate_form(this);">
...

</form>

You get the idea.  So basically I need to run some javascript to check
what the user has entered and if everything checks out then send it by
e-mail using FormMail.

This works just fine in IE but not in Firefox.  In Firefox, it does
not seem to process the javascript an simply send it to the cgi
regardless of what is entered.  Could someone enlighten me as to why
it is disregarding the onclick event?  How can I learn about creating
code that is truly universal?

Thank you

QB

I meant OnSubmit event rather than OnClick.

QB
 
H

Harlan Messinger

I created a form

<form id="feedback" name="feedback" method="post" action="cgi-bin/
FormMail.pl" onsubmit="return validate_form(this);">
...

</form>

You get the idea. So basically I need to run some javascript to check
what the user has entered and if everything checks out then send it by
e-mail using FormMail.

This works just fine in IE but not in Firefox. In Firefox, it does
not seem to process the javascript an simply send it to the cgi
regardless of what is entered. Could someone enlighten me as to why
it is disregarding the onclick event?

Because you don't have one?

Assuming you meant the onsubmit event, how can anyone tell if you
haven't bothered to show us the content of the function it calls?
How can I learn about creating
code that is truly universal?

It's a challenge, but start by sticking to the standards.

Javascript:
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

(there may be a newer release but this is the link I have)

Document Object Model (that is, accessing the parts of the web page):

http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html

I'm sure there are less technical guides to use instead of these source
documents but I don't know what they are.

Most importantly:

* don't use document.images, use document.getElementsByTagName("img")

* don't use document.forms, use document.getElementsByTagName("forms")

* don't use document.all.something, used
document.getElementById("something")

* use ID attributes for page elements you want to access from your
code, don't use name attributes
 
Q

question.boy

Because you don't have one?

Assuming you meant the onsubmit event, how can anyone tell if you
haven't bothered to show us the content of the function it calls?


It's a challenge, but start by sticking to the standards.

Javascript:http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262...

(there may be a newer release but this is the link I have)

Document Object Model (that is, accessing the parts of the web page):

http://www.w3.org/TR/2000/REC-DOM-L.../2003/REC-DOM-Level-2-HTML-20030109/html.html

I'm sure there are less technical guides to use instead of these source
documents but I don't know what they are.

Most importantly:

  * don't use document.images, use document.getElementsByTagName("img")

  * don't use document.forms, use document.getElementsByTagName("forms")

  * don't use document.all.something, used
document.getElementById("something")

  * use ID attributes for page elements you want to access from your
     code, don't use name attributes- Hide quoted text -

- Show quoted text -

Based on your response, and other, I now see that it is not a browser
coding issue but rather a javascript issue. I didn't think that was
the case, hence I didn't include all my code. After much testing, I
did identify the issue. I will take a close look at the links you
provided. I truly appreciate the guidance!!!

QB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top