quick hahahahahahahahahaha question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aaron
    Confirmed User
    • Mar 2003
    • 4452

    #1

    quick hahahahahahahahahaha question

    <!--

    //define the function

    function checkForm(formName) {

    //state that contactinfo is each feild on the form

    for( var contactinfo = 0; contactinfo < document.forms[formName].elements.length; contactinfo++)

    //if any fields are blank

    if ( document.forms[formName].elements[contactinfo].value hahahaha '' )
    {
    document.forms[formName].elements[contactinfo].focus();

    //alert the user which fields they did not fill out

    alert( 'Please fill in your ' + document.forms[formName].elements[contactinfo].name );
    }


    }
    //-->


    im using this like this >>

    form name="form" action="mailto:[email protected]" method="post" OnSubmit=checkForm("form")









    so - when i click submit it goes through and it alerts what fields are missing input but what do i need to do to make it so if the alert comes up it stops and doesn't submit!?
  • aaron
    Confirmed User
    • Mar 2003
    • 4452

    #2
    ugh it didnt show up



    here it is


    !--

    //define the function

    function checkForm(formName) {

    //state that contactinfo is each feild on the form

    for( var contactinfo = 0; contactinfo < document.forms[formName].elements.length; contactinfo++)

    //if any fields are blank

    if ( document.forms[formName].elements[contactinfo].value hahahaha '' )
    {
    document.forms[formName].elements[contactinfo].focus();

    //alert the user which fields they did not fill out

    alert( 'Please fill in your ' + document.forms[formName].elements[contactinfo].name );
    }


    }
    //--

    Comment

    • Chaldoray
      Confirmed User
      • Jul 2003
      • 2868

      #3
      hit me up on icq at 237842929 you cannot have the action mailto, who the hell told you that?

      Comment

      • xenigo
        Confirmed User
        • Jan 2001
        • 8067

        #4
        Here's a good site. WebMonkey

        Comment

        • SpaceAce
          Confirmed User
          • Jul 2002
          • 6493

          #5
          Take away the submit button and just use a regular button. Put the onClick() event on the regular button and label the button "submit".

          SpaceAce

          Comment

          • aaron
            Confirmed User
            • Mar 2003
            • 4452

            #6
            space ace i tried that, will you please icq me?? i need to have this done fast for school i can go back and actually learn it later

            Comment

            • aaron
              Confirmed User
              • Mar 2003
              • 4452

              #7
              nevermind i just did something (not quite sure what) and its working now

              Comment

              • aaron
                Confirmed User
                • Mar 2003
                • 4452

                #8
                wait a minute where do i actually have it submit the form though???

                Comment

                Working...