Announcement

Collapse
No announcement yet.

website issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • website issue

    Hello,

    I'm having issues with the website I made for my brother (only in IE, I think it is due to some update).

    I'm using an input form with a submit button with a onsubmit and an action:
    Code:
    form name="form1"  onsubmit="CheckMyForm()" method="post" action="sendmail.php"
    I recall that one of you here had a suggestion where the submit button would be replaced by a regular button calling the function CheckMyForm() and where the submit-action would be called within this function (as the combination of onsubmit and action might lead to issues).
    However, I can't seem to find it...

    Could anyone help with this?

    Thanks!


    Jörg
    pixar
    Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

  • #2
    try this:
    Code:
    form name="form1"  onsubmit="return CheckMyForm();" method="post" action="sendmail.php"

    Comment


    • #3
      Ok, I'll give it a go (will be later this week though).

      The other suggestion was to use a regular button rather than a submit button, have it call CheckMyForm, and have the submit action happen from there (but I don't know how to perform that last step).

      Jörg
      pixar
      Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

      Comment


      • #4
        shamelessly stolen from selfhtml.org .... guess you can handle the german language

        <html>
        <head>
        <title>Formulareingaben &uuml;berpr&uuml;fen</title>
        <script type="text/javascript">
        function chkFormular () {
        if (document.Formular.User.value == "") {
        alert("Bitte Ihren Namen eingeben!");
        document.Formular.User.focus();
        return false;
        }
        if (document.Formular.Ort.value == "") {
        alert("Bitte Ihren Wohnort eingeben!");
        document.Formular.Ort.focus();
        return false;
        }
        if (document.Formular.Mail.value == "") {
        alert("Bitte Ihre E-Mail-Adresse eingeben!");
        document.Formular.Mail.focus();
        return false;
        }
        if (document.Formular.Mail.value.indexOf("@") == -1) {
        alert("Keine E-Mail-Adresse!");
        document.Formular.Mail.focus();
        return false;
        }
        if (document.Formular.Alter.value == "") {
        alert("Bitte Ihr Alter eingeben!");
        document.Formular.Alter.focus();
        return false;
        }
        var chkZ = 1;
        for (i = 0; i < document.Formular.Alter.value.length; ++i)
        if (document.Formular.Alter.value.charAt(i) < "0" ||
        document.Formular.Alter.value.charAt(i) > "9")
        chkZ = -1;
        if (chkZ == -1) {
        alert("Altersangabe keine Zahl!");
        document.Formular.Alter.focus();
        return false;
        }
        }
        </script>
        </head>
        <body>

        <h1>Formular</h1>

        <form name="Formular" action="http://de.selfhtml.org/cgi-bin/formview.pl"
        method="post" onsubmit="return chkFormular()">
        <pre>
        Name: <input type="text" size="40" name="User">
        Wohnort: <input type="text" size="40" name="Ort">
        E-Mail: <input type="text" size="40" name="Mail">
        Alter: <input type="text" size="40" name="Alter">
        Formular: <input type="submit" value="Absenden"><input type="reset" value="Abbrechen">

        Zum Absenden muss eine Internet-Verbindung bestehen!
        </pre>
        </form>

        </body>
        </html>
        "Women don't want to hear a man's opinion, they just want to hear their opinion in a deeper voice."

        Comment


        • #5
          Appears quite similar with the "return checkform();" in the action field... Strangely enought the above function never returns true...

          Jörg
          pixar
          Dream as if you'll live forever. Live as if you'll die tomorrow. (James Dean)

          Comment

          Working...
          X