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

Processing Formular Data

Expand Messages
  • Teifke Sascha ZFF FW-EI
    Hello Perl-Gurus, I ve got a formular with 3 text-input fields: name , phone , street . Now I want to do the following: If you enter the value name into
    Message 1 of 3 , May 2, 2001
    • 0 Attachment
      Hello Perl-Gurus,

      I've got a formular with 3 text-input fields: "name", "phone", "street".
      Now I want to do the following:
      If you enter the value "name" into the field and you press the "get date"
      button the
      name-value ist sent to a script that gets the data and fills out the fields
      "phone" and "street".
      If you fill out all values another script will be started an process the
      form data.

      The Problem ist, that I don't know how to make one formular with 2 submit
      buttons and 2 scripts.

      Thank you!
      Sascha
    • Oliver Manickum
      Hey There, I am going to assume that you are using a webpage for ur forms... do this function checkForm(theForm) { if
      Message 2 of 3 , May 2, 2001
      • 0 Attachment
        Hey There,

        I am going to assume that you are using a webpage for ur forms...

        do this


        <script language="JavaScript">

        function checkForm(theForm) {

        if (theForm.submit.value == "Get Date") {
        location.replace("postthat.pl?name=" + theForm.name.value + "&phone=" +
        theForm.phone.value) ;
        return(false)
        }
        return (true);
        }

        </script>



        <form name="whateva" action="postthis.pl" onSubmit="return checkForm(this)">

        <!-- form elements here..... -->
        <input type="submit" name="submit" value="Get Date">
        <input type="submit" name="submit" value="Submit All">
        </form>


        - I hope i was on the right track...

        - Olly

        -----Original Message-----
        From: Teifke Sascha ZFF FW-EI [mailto:Sascha.Teifke@...]
        Sent: 02 May 2001 09:19
        To: 'perl beginner'
        Subject: [PBML] Processing Formular Data


        Hello Perl-Gurus,

        I've got a formular with 3 text-input fields: "name", "phone", "street".
        Now I want to do the following:
        If you enter the value "name" into the field and you press the "get date"
        button the
        name-value ist sent to a script that gets the data and fills out the fields
        "phone" and "street".
        If you fill out all values another script will be started an process the
        form data.

        The Problem ist, that I don't know how to make one formular with 2 submit
        buttons and 2 scripts.

        Thank you!
        Sascha



        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • Chris Brown
        I assume we re talking about a web application here, if not ignore this :-) I think the easiest way to solve your problem is to have one submit button and one
        Message 3 of 3 , May 2, 2001
        • 0 Attachment
          I assume we're talking about a web application here, if not ignore this :-)
           
          I think the easiest way to solve your problem is to have one submit button and one perl script.
           
          When the button is pressed, your script checks if the phone and street fields have been filled. If not, it looks up (if necessary) and rebuilds the form with the values inserted in the appropriate boxes. For example, send this to a HTML page after setting the variables $input_name, $input_phone and $input_street to the ones you require:
           
          print '<FORM ACTION="insert_script_url" METHOD=post>';
          print '<INPUT TYPE="text" NAME="input_name" VALUE="$name">';
          print '<INPUT TYPE="text" NAME="input_phone" VALUE="$phone">';
          print '<INPUT TYPE="text" NAME="input_street" VALUE="$street">';
          print '<INPUT TYPE="submit" VALUE="Go">';
          print '</FORM>';
           
          The button on the new form sends the content back to the same script.
           
          If the script realises all forms have been filled in, it redirects to an apporpriate sub and does whatever you want it to do.
           
          HTH
          Chris
          ----- Original Message -----
          Sent: Wednesday, May 02, 2001 8:18 AM
          Subject: [PBML] Processing Formular Data

          Hello Perl-Gurus,

          I've got a formular with 3 text-input fields: "name", "phone", "street".
          Now I want to do the following:
          If you enter the value "name" into the field and you press the "get date"
          button the
          name-value ist sent to a script that gets the data and fills out the fields
          "phone" and "street".
          If you fill out all values another script will be started an process the
          form data.

          The Problem ist, that I don't know how to make one formular with 2 submit
          buttons and 2 scripts.

          Thank you!
          Sascha

           

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


        Your message has been successfully submitted and would be delivered to recipients shortly.