baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from Pualani on 10/3 2003, 01:24 -10:00

    registration forms


      Hi, funny how we all find others for help I came across this site while painstakingly hunting down codes to make a secure registration form for a new web site not yet built for a friend. I have lots of problems getting the registration form going & working would you might have info on my situation?

      Pualani

    Your reply:

    Name: EMail: WWW:
    Subject:
    Text:
    Timezone:

    Post a new message


 All messages from this thread: To the list 
    Message from Odysseus on 10/5 2003, 21:53 -08:00

    Checking entries before submitting


      Is there a simple way to check user entries before the form gets submitted?

      Ideally, I would like to check the values that are about to be submitted, and if there is an error I would like to print out some helpful error message, otherwise I want everything to proceed as normal.

      If someone could provide some sample code on how to do this, I would be grateful.

      Note, I've tried the following:

      get "Name==$_put{To}", "main";
      if ($Name eq "")
      {
      out<<EOF;
      Can't find the person who is getting the credit. Please check the spelling of the name.
      EOF

      }

      But the problem is that the error comes up when the form is first visited.

     Post a reply

    Message from Christoph Bergmann on 10/6 2003, 17:37 +01:00
    EMail: info@baseportal.com

    Re: Checking entries before submitting


      I'm not sure if you want to check the entries before they get stored or if you want to check search submissions (your posted code looks like this)?

      In the first case write this before your <do action=all ... >

      <perl>
      if(%_put)
      {
      if($_put{Name} eq "")
      {
          out "Please input your name!";
          $_get{cmd}="";
        }

      }
      </perl>

      In the second case your code is not too bad, but you don't need $_put{To} ($_put{...} is for storing data). Unfortunately I don't know the rest of your code so I can only guess. You probably need s.th. like this:

      <perl>
      if(@_sel)
      {
      get "Name==$Name", "main";
      if($_amount==0)
        {
          out<<EOF;
      Can't find the person who is getting the credit. Please check the spelling of the name.
      EOF
        }

      }

      But it depends on the rest of your code. Pls could you post all of it?

     Post a reply
     
 Messages from 3300 to 3450: To the input form 
<< Newest messages | < Newer messages | To the input form | Older messages > | Oldest messages >>


Back to the homepage

© baseportal.com. All rights reserved. Terms of use



baseportal.com