Announcement

Collapse
No announcement yet.

Mailform Validation Fields

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

    Mailform Validation Fields

    Hi All

    I have a modified mailform script that allows collection of extra data but some people dont fill in the parts that are required, like post code so wondered if some one can give me some help with the checking part of the script.

    I am guessing the bit i need is here
    Code:
     # Validate the content of the fields
        #
        my $sError;
        if ($sName eq "")
            {
            $sError .= ACTINIC::GetRequiredMessage(-1, 2370);
            }
        if ($sSubject eq "")
            {
            $sError .= ACTINIC::GetRequiredMessage(-1, 2372);
            }
        if ($sEmailRecpt eq "")
            {
            $sError .= ACTINIC::GetRequiredMessage(-1, 2371);
            }
        elsif ($sEmailRecpt !~ /.+\@.+\..+/)
            {
            $sError .= ACTINIC::GetPhrase(-1, 2378) . "\r\n";
            }
        if ($sMessage eq "")
            {
            $sError .= ACTINIC::GetRequiredMessage(-1, 2373);
            }
        #
    and the info i want checking to make sure an entry has been made is
    Code:
            $sTextMailBody .= "PostCode: " . $::g_InputHash{'PostCode'} . "\r\n";
    I have tried but all i have managed to do is break my script (so put it back as it was for now)

    hope someone can help

    Cheers
    Darren

    #2
    can anyone help with this piece of code?

    It really would be appreciated

    Darren

    Comment


      #3
      Sorry Darren,

      I'd help if I could but I use my own php script for mailing forms so haven't looked at the actinic mailform.

      It should just be a case of checking the variable you're using for 'postcode' isn't empty, but you do do face the problem that there's no specific error message in Actinic for 'Postcode is a required field' (although you could maybe borrow one from the checkout stage).

      Mike
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

      -----------------------------------------

      Comment

      Working...
      X