Html form action behavior

Discussion in 'HTML' started by question.boy@hotmail.com, Sep 1, 2008.

  1. Guest

    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
    , Sep 1, 2008
    #1
    1. Advertising

  2. Guest

    On Sep 1, 6:00 pm, wrote:
    > 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
    , Sep 1, 2008
    #2
    1. Advertising

  3. wrote:
    > On Sep 1, 6:00 pm, wrote:
    >> 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.


    URL????

    Who knows what validate_form() contains...

    Hint the problem is in your JavaScript...

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Sep 1, 2008
    #3
  4. wrote:
    > 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
    Harlan Messinger, Sep 2, 2008
    #4
  5. Guest

    On Sep 1, 9:10 pm, Harlan Messinger
    <> wrote:
    > wrote:
    > > 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...
    >
    > (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
    , Sep 2, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Bloggs
    Replies:
    1
    Views:
    703
    Sudsy
    Aug 3, 2003
  2. rjweytens
    Replies:
    6
    Views:
    16,031
    rjweytens
    Jun 25, 2004
  3. runescience

    Struts mapping action to action???

    runescience, Feb 6, 2006, in forum: Java
    Replies:
    3
    Views:
    1,793
    runescience
    Feb 7, 2006
  4. vyshu
    Replies:
    1
    Views:
    2,511
    Richard Senior
    Apr 27, 2007
  5. John
    Replies:
    0
    Views:
    829
Loading...

Share This Page