Loading ...
Sorry, an error occurred while loading the content.

question of validation data for form with a image button

Expand Messages
  • chenjhua@hotmail.com
    Hi, I have a question about javascript form validation. I use a image as the button, and try to validate the form data.But it seems it doesn t work. Does
    Message 1 of 2 , Nov 6, 2001
    • 0 Attachment
      Hi, I have a question about javascript form validation.
      I use a image as the button, and try to validate the form data.But it
      seems it doesn't work. Does anybody have any idea?

      Thanks.

      Jianhua chen

      <script language="JavaScript">
      <!--

      function FormSubmit() {


      if (document.form1.companyname.value.length==0) {
      alert("Please type in the name of company.")

      document.form1.companyname.focus();
      return false;
      }

      document.form1.submit();

      }

      //-->
      </script>



      <form name="form1" method="post">
      <input type="text" name="companyname" maximumsize="25">
      </form>

      <a href="javascript:FormSubmit()"><img
      src="/shared/images/buttons/submit.gif" border="0"></a
    • Ronald S. Cook
      If Request.Form( cmdUpdate.x ).Count Then The Update button was clicked. ...
      Message 2 of 2 , Nov 6, 2001
      • 0 Attachment
        If Request.Form("cmdUpdate.x").Count Then 'The Update button was
        clicked.

        <INPUT type="image" id="cmdUpdate" name="cmdUpdate"
        src="Images\Update.gif">

        -----Original Message-----
        From: chenjhua@...
        Sent: Tue 11/6/2001 3:54 PM
        To: 123javascripts@yahoogroups.com
        Cc:
        Subject: [123javascripts] question of validation data for form
        with a image button



        Hi, I have a question about javascript form validation.
        I use a image as the button, and try to validate the form
        data.But it
        seems it doesn't work. Does anybody have any idea?

        Thanks.

        Jianhua chen

        <script language="JavaScript">
        <!--

        function FormSubmit() {


        if (document.form1.companyname.value.length==0) {
        alert("Please type in the name of company.")

        document.form1.companyname.focus();
        return false;
        }

        document.form1.submit();

        }

        //-->
        </script>



        <form name="form1" method="post">
        <input type="text" name="companyname" maximumsize="25">
        </form>

        <a href="javascript:FormSubmit()"><img
        src="/shared/images/buttons/submit.gif" border="0"></a





        Your use of Yahoo! Groups is subject to
        http://docs.yahoo.com/info/terms/






        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.