Announcement

Collapse
No announcement yet.

Help with Perl/Actinic syntax

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

    Help with Perl/Actinic syntax

    I have managed to add several extra fields to 'Contact Us'

    It seems to be working ok with one exception, If one of the mandatory fields is left blank, It re-writes the page and reports the empty field/s (as it should).

    However, It empties all the other fields, making the user having to start over.

    The original fields, (yet to be removed from the form) redisplay the value of the entered fields.

    I have experimented with variations of the following segmant from MailForm.pl but I am not able to get the 'Telephone' field to display the value if the user entered it in the first place.
    sub DisplayMailPage
    {
    my ($sName, $sSubject, $sEmail, $sText, $sTelephone) = @_; #### Line modified 3 Mar 2007
    #
    # Display the mail page
    #
    my %VarTable;
    $VarTable{'NETQUOTEVAR:NAMEVALUE'} = $sName;
    $VarTable{'NETQUOTEVAR:EMAILVALUE'} = $sEmail;
    $VarTable{'NETQUOTEVAR:SUBJECTVALUE'} = $sSubject;
    $VarTable{'NETQUOTEVAR:MESSAGEVALUE'} = $sText;
    $VarTable{'$sTelephone'} = $sTelephone; # new line 3 Mar 2007
    my @Response = ACTINIC::TemplateFile(ACTINIC::GetPath() . "mail_form.html", \%VarTable); # make the substitutions
    if ($Response[0] != $::SUCCESS)
    Once I get the Telephone field working correctly, I can set up the rest...

    As you can guess, Perl is not my native language. Any advice on this will be much appreciated


    Thanks
    www.yandles.co.uk
    www.websilk.co.uk
    Today is the tomorrow that I worried about yesterday.
    So far, all is well. Am I still worried? YES! Watch some b.....d mess it up!

    #2
    Further up in the perl code where the variables are declared, have you added the declaration for $sTelephone?
    Bill
    www.egyptianwonders.co.uk
    Text directoryWorldwide Actinic(TM) shops
    BC Ness Solutions Support services, custom software
    Registered Microsoft™ Partner (ISV)
    VoIP UK: 0131 208 0605
    Located: Alexandria, EGYPT

    Comment


      #3
      The line

      $VarTable{'$sTelephone'} = $sTelephone; # new line 3 Mar 2007

      should be

      $VarTable{'NETQUOTEVAR:TELEPHONEVALUE'} = $sTelephone; # new line 3 Mar 2007

      And you'll have to add the value="NETQUOTEVAR:TELEPHONEVALUE" into the telephone input field in the Contact Us Bulk area layout.

      Also make sure you're passing the correct number of arguments when DisplayMailPage is called. Make sure you deal with all the places it is called from as this routine is also used for the backoffice emails.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Originally posted by NormanRouxel
        The line

        $VarTable{'$sTelephone'} = $sTelephone; # new line 3 Mar 2007

        should be

        $VarTable{'NETQUOTEVAR:TELEPHONEVALUE'} = $sTelephone; # new line 3 Mar 2007

        And you'll have to add the value="NETQUOTEVAR:TELEPHONEVALUE" into the telephone input field in the Contact Us Bulk area layout.

        Also make sure you're passing the correct number of arguments when DisplayMailPage is called. Make sure you deal with all the places it is called from as this routine is also used for the backoffice emails.
        I tried that variable in .pl but did not add it to the Bulk Layout! I will try later and report back
        Make sure you deal with all the places it is called from as this routine is also used for the backoffice emails.
        The added fields will only appear in 'Contact Us', however does it mean that I have to visit all the Bulk layouts and add the 'value="NETQUOTEVAR:TELEPHONEVALUE" ' that call MailForm.pl even if they dont use the new fields/variables?
        www.yandles.co.uk
        www.websilk.co.uk
        Today is the tomorrow that I worried about yesterday.
        So far, all is well. Am I still worried? YES! Watch some b.....d mess it up!

        Comment


          #5
          Originally posted by wjcampbe
          Further up in the perl code where the variables are declared, have you added the declaration for $sTelephone?
          Thanks Bill

          Yes it was declared as are all the other variables.
          www.yandles.co.uk
          www.websilk.co.uk
          Today is the tomorrow that I worried about yesterday.
          So far, all is well. Am I still worried? YES! Watch some b.....d mess it up!

          Comment


            #6
            does it mean that I have to visit all the Bulk layouts and add the 'value="NETQUOTEVAR:TELEPHONEVALUE" ' that call MailForm.pl even if they dont use the new fields/variables
            No, I don't think so. Test and see. Also make sure that the offline emails (those from the Order Processing still work).
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              I have managed to get it running sweetly by creating new variables. HOWEVER, a very nasty thought has occoured to me:

              1) I will have a new set of fields and associated variables in the Contact Us form
              2) In MailForm.pl
              a) I have declaired the variables
              b) I have added the variable to the mandatory field checking routine
              c) added them to the page re-write routine

              All works well for the 'Contact Us' form...

              BUT.. in the other forms that call MailForm.pl, because of the user defined variable being added, will those other forms fail because the user variable for Contact Us are empty ( = "") in those other forms.

              Advice needed please.
              www.yandles.co.uk
              www.websilk.co.uk
              Today is the tomorrow that I worried about yesterday.
              So far, all is well. Am I still worried? YES! Watch some b.....d mess it up!

              Comment


                #8
                Only way is to test and see.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Originally posted by NormanRouxel
                  Only way is to test and see.
                  Gee - I wish I had thought of that!


                  I have just survived a stroke and my memory is returning but there are times, like this, when it does let me down

                  Thats my excuse any way...
                  www.yandles.co.uk
                  www.websilk.co.uk
                  Today is the tomorrow that I worried about yesterday.
                  So far, all is well. Am I still worried? YES! Watch some b.....d mess it up!

                  Comment

                  Working...
                  X