Form or DIv

Hey Guys,
                I am new to web developement and I had one question . This is more conceptual than subjective:
I was just thinking that I have seen many HTML codes that does not contain a <form> tag and rather every element and all related code is contained in <Body> tag and those web pages look OK.
So that leaves me with one conclusion that we really have only one functional reason behind the <form> tag that is to use it as a container. Now, if we talk about container then I think I can use a master <Div> container to contain other <Div>s too. In this case that master <Div> becomes my container.
So I have tow precise questions
1. Does form serve any other purpose rather than being acontainer for other elements?
2. What is difference between using <form> as a container and <div> as a container?
Kunal

Indeed the form element can act just like a div in that respect - with css you can style it as you would a div: size it, position it, add margins, padding, backgrounds, whatever you want.  (Unlike a div though it has a specific attribute that tell the submit button what to do - there is an action attribute, specifically.  And form elements require the form tag as a wrapper.  So a div and a form are certainly not interchangeable.  )
E. Michael Brandt
www.divahtml.com
www.divahtml.com/products/scripts_dreamweaver_extensions.php
Standards-compliant scripts and Dreamweaver Extensions
www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, et alia

Similar Messages

  • Form won't submit, newbie, probably being an idiot

    Probbally being an absolute idiot as completely new to web design, but really stuck, all help hugely appreciated...
    form on http://www.refuseboredom.com/EasterHolidays.html, form is validating itself but doesnt post??
    its supposed to be going to a FormMail.pl which is in the base directory, hosting with godaddy who accept perl scripts and say the script can be put anywhere on the server,
    Don't know what i'm missing!!
    Form Code:
    <div id ="form" >
          <form action="FormMail.pl" method="post" name="form1" target="_top" id="bookingform">
         <input type=hidden name="redirect" value="http://www.refuseboredom.com/thankyou.html" />
         <h2>BOOK HERE</h2>
         <input type=hidden name="recipient" value="[email protected]">
           <div>
            <span id="sprytextfield1">
            <label for="FirstName">Parent/Guardian First Name:</label>
            <input type="text" name="FirstName" id="FirstName" tabindex="1" />
            <span class="textfieldRequiredMsg">A value is required.</span></span>
            </div>
    <span id="sprytextfield2">
    <label for="LastName">Parent/Guardian Surname:</label>
    <input type="text" name="LastName" id="LastName" tabindex="2" />
    <span class="textfieldRequiredMsg">A value is required.</span></span>
         <div>
          <span id="sprytextfield3">
          <label for="Address1">Address 1st line:</label>
          <input type="text" name="Address1" id="Address1" tabindex="3" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          </div>
          <div>
          <span id="sprytextfield4">
          <label for="Address2">Address 2nd Line:</label>
          <input type="text" name="Address2" id="Address2" tabindex="4" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          </div>
          <div>
          <span id="sprytextfield5">
          <label for="City">City: </label>
          <input type="text" name="City" id="City" tabindex="5" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          </div>
          <div>
          <span id="sprytextfield6">
          <label for="Postcode">Postcode:</label>
          <input type="text" name="Postcode" id="Postcode" tabindex="6" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          </div>
          <div>
          <span id="sprytextfield7">
          <label for="Phone">Prefered Contact number:</label>
          <input type="text" name="Phone" id="Phone" tabindex="7" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          </div>
          <div>
          <span id="sprytextfield8">
          <label for="Email">Email Address</label>
          <input type="text" name="Email" id="Email" tabindex="8" />
          <span class="textfieldRequiredMsg"></span><span class="textfieldInvalidFormatMsg">Not a Valid E-mail Address</span></span>
          </div>
          <div id="select1">
          <label for="Quantity"> Number of children you would like to book for:</label>
          <select name="Quantity" id="Quantity" tabindex="9" class="Quantity" >
            <option>1</option>
            <option>2</option>
            <option>3</option>
          </select>
          </div>
          <div id="Child1Div">
          <span id="sprytextfield9">
          <label for="Child1">Child's Name:</label>
          <input type="text" name="Child1" id="Child1" tabindex="10" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          <span id="spryselect2">
          <label for="Child1Age">Child's Age:</label>
          <select name="Child1Age" id="Child1Age" tabindex="11">
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
          </select>
          <span class="selectRequiredMsg">Please select an item.</span></span>
          </div>
      <div id="Child2Div">
        <span id="sprytextfield10">
          <label for="child2">Child's name:</label>
          <input type="text" name="child2" id="child2" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          <span id="spryselect3">
          <label for="Child2Age">Child's Age:</label>
          <select name="Child2Age" id="Child2Age">
          <option>10</option>
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
          </select>
          <span class="selectRequiredMsg">Please select an item.</span></span>
    </div>
       <div id="Child3Div">
          <span id="sprytextfield11">
          <label for="Child3">Child's Name:</label>
          <input type="text" name="Child3" id="Child3" />
          <span class="textfieldRequiredMsg">A value is required.</span></span>
          <span id="spryselect4">
          <label for="Child3Age">Child's Age:</label>
          <select name="Child3Age" id="Child3Age">
            <option value="10">10</option>
            <option value="11">11</option>
            <option value="12">12</option>
            <option value="13">13</option>
            <option value="14">14</option>
            <option value="15">15</option>
          </select>
          <span class="selectRequiredMsg">Please select an item.</span></span>
        </div>
        <div>
          <span id="spryselect5">
          <label for="Type">Holiday Dates:</label>
          <select name="Type" id="Type" tabindex="12">
            <option value="Easter2week">2 Week Easter Holiday: April 2nd -  April 13th</option>
            <option value="April2nd1week">First Week: April 2nd - April 6th</option>
            <option value="April9th1week">Second Week: April 9th - April 13th</option>
            <option value="Easterspecial">Easter Special: 2 weeks</option>
          </select>
          <span class="selectRequiredMsg">Please select an item.</span></span>
              </div>
          <div id="Notes">
          <label for="Notes">Please use this area to let us know of any special requirements including medical and dietary needs that we may need to be aware of, if your child is applying with a friend please let us know here as well so we can try and make sure their on the same team: </label><br />
          <textarea name="Notes" id="Notes" cols="45" rows="5" tabindex="13"></textarea>
          </div>
          <input name="submit"  type="submit" id="submit" tabindex="14" value="Book Now" />
          </form>
          </div>
    FormMail.pl Code:
    #!/usr/bin/perl
    # FormMail                        Version 1.93                               #
    # Copyright 1995-2009 Matt Wright [email protected]                    #
    # Created 1995-06-09              Last Modified 2009-07-14                   #
    # Matt's Script Archive, Inc.:    http://www.scriptarchive.com/              #
    # COPYRIGHT NOTICE                                                           #
    # Copyright 1995-2009 Matthew M. Wright  All Rights Reserved.                #
    # FormMail may be used and modified free of charge by anyone so long as this #
    # copyright notice and the comments above remain intact.  By using this      #
    # code you agree to indemnify Matthew M. Wright from any liability that      #
    # might arise from its use.                                                  #
    # Selling the code for this program without prior written consent is         #
    # expressly forbidden.  In other words, please ask first before you try and  #
    # make money off of my program.                                              #
    # Obtain permission before redistributing this software over the Internet or #
    # in any other medium. In all cases copyright and header must remain intact. #
    # ACCESS CONTROL FIX: Peter D. Thompson Yezek                                #
    # XSS + REDIRECT FIX: Francesco Ongaro, Giovanni Pellerano & Antonio Parata  #
    #   v1.93             http://www.ush.it/team/ush/hack-formmail_192/adv.txt   #
    # Define Variables                                                           #
    #      Detailed Information Found In README File.                            #
    # $mailprog defines the location of your sendmail program on your unix       #
    # system. The flags -i and -t should be passed to sendmail in order to       #
    # have it ignore single dots on a line and to read message for recipients    #
    $mailprog = 'smtp.europe.secureserver.net -i -t';
    # @referers allows forms to be located only on servers which are defined     #
    # in this field.  This is a security fix to prevent others from using your   #
    # FormMail script on their web site.                                         #
    @referers = ('refuseboredom.com');
    # @recipients defines the e-mail addresses or domain names that e-mail can   #
    # be sent to.  This must be filled in correctly to prevent SPAM and allow    #
    # valid addresses to receive e-mail.  Read the documentation to find out how #
    # this variable works!!!  It is EXTREMELY IMPORTANT.                         #
    @recipients = ('^admin\@refuseboredom\.com');
    # ACCESS CONTROL FIX: Peter D. Thompson Yezek                                #
    # @valid_ENV allows the sysadmin to define what environment variables can    #
    # be reported via the env_report directive.  This was implemented to fix     #
    # the problem reported at http://www.securityfocus.com/bid/1187              #
    @valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');
    # Done                                                                       #
    # Check Referring URL
    &check_url;
    # Retrieve Date
    &get_date;
    # Parse Form Contents
    &parse_form;
    # Check Required Fields
    &check_required;
    # Send E-Mail
    &send_mail;
    # Return HTML Page or Redirect User
    &return_html;
    # NOTE rev1.91: This function is no longer intended to stop abuse, that      #
    #    functionality is now embedded in the checks made on @recipients and the #
    #    recipient form field.                                                   #
    sub check_url {
        # Localize the check_referer flag which determines if user is valid.     #
        local($check_referer) = 0;
        # If a referring URL was specified, for each valid referer, make sure    #
        # that a valid referring URL was passed to FormMail.                     #
        if ($ENV{'HTTP_REFERER'}) {
            foreach $referer (@referers) {
                if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) {
                    $check_referer = 1;
                    last;
        else {
            $check_referer = 1;
        # If the HTTP_REFERER was invalid, send back an error.                   #
        if ($check_referer != 1) { &error('bad_referer') }
    sub get_date {
        # Define arrays for the day of the week and month of the year.           #
        @days   = ('Sunday','Monday','Tuesday','Wednesday',
                   'Thursday','Friday','Saturday');
        @months = ('January','February','March','April','May','June','July',
                   'August','September','October','November','December');
        # Get the current time and format the hour, minutes and seconds.  Add    #
        # 1900 to the year to get the full 4 digit year.                         #
        ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6];
        $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec);
        $year += 1900;
        # Format the date.                                                       #
        $date = "$days[$wday], $months[$mon] $mday, $year at $time";
    sub parse_form {
        # Define the configuration associative array.                            #
        %Config = ('recipient','',          'subject','',
                   'email','',              'realname','',
                   'redirect','',           'bgcolor','',
                   'background','',         'link_color','',
                   'vlink_color','',        'text_color','',
                   'alink_color','',        'title','',
                   'sort','',               'print_config','',
                   'required','',           'env_report','',
                   'return_link_title','',  'return_link_url','',
                   'print_blank_fields','', 'missing_fields_redirect','');
        # Determine the form's REQUEST_METHOD (GET or POST) and split the form   #
        # fields up into their name-value pairs.  If the REQUEST_METHOD was      #
        # not GET or POST, send an error.                                        #
        if ($ENV{'REQUEST_METHOD'} eq 'GET') {
            # Split the name-value pairs
            @pairs = split(/&/, $ENV{'QUERY_STRING'});
        elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
            # Get the input
            read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
            # Split the name-value pairs
            @pairs = split(/&/, $buffer);
        else {
            &error('request_method');
        # For each name-value pair:                                              #
        foreach $pair (@pairs) {
            # Split the pair up into individual variables.                       #
            local($name, $value) = split(/=/, $pair);
            # Decode the form encoding on the name and value variables.          #
            # v1.92: remove null bytes                                           #
            $name =~ tr/+/ /;
            $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
            $name =~ tr/\0//d;
            $value =~ tr/+/ /;
            $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
            $value =~ tr/\0//d;
            # If the field name has been specified in the %Config array, it will #
            # return a 1 for defined($Config{$name}}) and we should associate    #
            # this value with the appropriate configuration variable.  If this   #
            # is not a configuration form field, put it into the associative     #
            # array %Form, appending the value with a ', ' if there is already a #
            # value present.  We also save the order of the form fields in the   #
            # @Field_Order array so we can use this order for the generic sort.  #
            if (defined($Config{$name})) {
                $Config{$name} = $value;
            else {
                if ($Form{$name} ne '') {
                    $Form{$name} = "$Form{$name}, $value";
                else {
                    push(@Field_Order,$name);
                    $Form{$name} = $value;
        # The next six lines remove any extra spaces or new lines from the       #
        # configuration variables, which may have been caused if your editor     #
        # wraps lines after a certain length or if you used spaces between field #
        # names or environment variables.                                        #
        $Config{'required'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
        $Config{'required'} =~ s/(\s+)?\n+(\s+)?//g;
        $Config{'env_report'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
        $Config{'env_report'} =~ s/(\s+)?\n+(\s+)?//g;
        $Config{'print_config'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
        $Config{'print_config'} =~ s/(\s+)?\n+(\s+)?//g;
        # Split the configuration variables into individual field names.         #
        @Required = split(/,/,$Config{'required'});
        @Env_Report = split(/,/,$Config{'env_report'});
        @Print_Config = split(/,/,$Config{'print_config'});
        # ACCESS CONTROL FIX: Only allow ENV variables in @valid_ENV in          #
        # @Env_Report for security reasons.                                      #
        foreach $env_item (@Env_Report) {
            foreach $valid_item (@valid_ENV) {
                if ( $env_item eq $valid_item ) { push(@temp_array, $env_item) }
        @Env_Report = @temp_array;
    sub check_required {
        # Localize the variables used in this subroutine.                        #
        local($require, @error);
        # The following insures that there were no newlines in any fields which  #
        # will be used in the header.                                            #
        if ($Config{'subject'} =~ /(\n|\r)/m || $Config{'email'} =~ /(\n|\r)/m ||
            $Config{'realname'} =~ /(\n|\r)/m || $Config{'recipient'} =~ /(\n|\r)/m) {
            &error('invalid_headers');
        # Fix XSS + HTTP Header Injection for v1.93
        foreach $lfield ('redirect', 'return_link_url') {
            # Strip new lines
            $Config{$lfield} =~ s/(\n|\r)//mg;
            # Only allow certain handlers to avoid javascript:/data: tricks
            if ($Config{$lfield} !~ /^\s*\// &&
                $Config{$lfield} !~ /^\s*(http|https|ftp):\/\//) {
                $Config{$lfield} = '';
        if (!$Config{'recipient'}) {
            if (!defined(%Form)) { &error('bad_referer') }
            else                 { &error('no_recipient') }
        else {
            # This block of code requires that the recipient address end with    #
            # a valid domain or e-mail address as defined in @recipients.        #
            foreach $send_to (split(/,/,$Config{'recipient'})) {
                foreach $recipient (@recipients) {
                    if ($send_to =~ /$recipient$/i) {
                        push(@send_to,$send_to); last;
            if ($#send_to < 0) { &error('no_recipient') }
            $Config{'recipient'} = join(',',@send_to);
        # For each require field defined in the form:                            #
        foreach $require (@Required) {
            # If the required field is the email field, the syntax of the email  #
            # address if checked to make sure it passes a valid syntax.          #
            if ($require eq 'email' && !&check_email($Config{$require})) {
                push(@error,$require);
            # Otherwise, if the required field is a configuration field and it   #
            # has no value or has been filled in with a space, send an error.    #
            elsif (defined($Config{$require})) {
                if ($Config{$require} eq '') { push(@error,$require); }
            # If it is a regular form field which has not been filled in or      #
            # filled in with a space, flag it as an error field.                 #
            elsif (!defined($Form{$require}) || $Form{$require} eq '') {
                push(@error,$require);
        # If any error fields have been found, send error message to the user.   #
        if (@error) { &error('missing_fields', @error) }
    sub return_html {
        # Local variables used in this subroutine initialized.                   #
        local($key,$sort_order,$sorted_field);
        # Now that we have finished using form values for any e-mail related     #
        # reasons, we will convert all of the form fields and config values      #
        # to remove any cross-site scripting security holes.                     #
        local($field);
        foreach $field (keys %Config) {
            $safeConfig{$field} = &clean_html($Config{$field});
        foreach $field (keys %Form) {
            $Form{$field} = &clean_html($Form{$field});
        # If redirect option is used, print the redirectional location header.   #
        if ($Config{'redirect'}) {
            print "Location: $safeConfig{'redirect'}\n\n";
        # Otherwise, begin printing the response page.                           #
        else {
            # Print HTTP header and opening HTML tags.                           #
            print "Content-type: text/html\n\n";
            print "<html>\n <head>\n";
            # Print out title of page                                            #
            if ($Config{'title'}) { print "<title>$safeConfig{'title'}</title>\n" }
            else                  { print "<title>Thank You</title>\n"        }
            print " </head>\n <body";
            # Get Body Tag Attributes                                            #
            &body_attributes;
            # Close Body Tag                                                     #
            print ">\n  <center>\n";
            # Print custom or generic title.                                     #
            if ($Config{'title'}) { print "<h1>$safeConfig{'title'}</h1>\n" }
            else { print "<h1>Thank You For Filling Out This Form</h1>\n" }
            print "</center>\n";
            print "Below is what you submitted to $safeConfig{'recipient'} on ";
            print "$date<p><hr size=1 width=75\%><p>\n";
            # If a sort order is specified, sort the form fields based on that.  #
            if ($Config{'sort'} =~ /^order:.*,.*/) {
                # Set the temporary $sort_order variable to the sorting order,   #
                # remove extraneous line breaks and spaces, remove the order:    #
                # directive and split the sort fields into an array.             #
                $sort_order = $Config{'sort'};
                $sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
                $sort_order =~ s/(\s+)?\n+(\s+)?//g;
                $sort_order =~ s/order://;
                @sorted_fields = split(/,/, $sort_order);
                # For each sorted field, if it has a value or the print blank    #
                # fields option is turned on print the form field and value.     #
                foreach $sorted_field (@sorted_fields) {
                    local $sfname = &clean_html($sorted_field);
                    if ($Config{'print_blank_fields'} || $Form{$sorted_field} ne '') {
                        print "<b>$sfname:</b> $Form{$sorted_field}<p>\n";
            # Otherwise, use the order the fields were sent, or alphabetic.      #
            else {
                # Sort alphabetically if requested.
                if ($Config{'sort'} eq 'alphabetic') {
                    @Field_Order = sort @Field_Order;
                # For each form field, if it has a value or the print blank      #
                # fields option is turned on print the form field and value.     #
                foreach $field (@Field_Order) {
                    local $fname = &clean_html($field);
                    if ($Config{'print_blank_fields'} || $Form{$field} ne '') {
                        print "<b>$fname:</b> $Form{$field}<p>\n";
            print "<p><hr size=1 width=75%><p>\n";
            # Check for a Return Link and print one if found.                    #
            if ($Config{'return_link_url'} && $Config{'return_link_title'}) {
                print "<ul>\n";
                print "<li><a href=\"$safeConfig{'return_link_url'}\">$safeConfig{'return_link_title'}</a>\n";
                print "</ul>\n";
            # Print the page footer.                                             #
            print <<"(END HTML FOOTER)";
            <hr size=1 width=75%><p>
            <center><font size=-1><a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
    A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a></font></center>
            </body>
           </html>
    (END HTML FOOTER)
    sub send_mail {
        # Localize variables used in this subroutine.                            #
        local($print_config,$key,$sort_order,$sorted_field,$env_report);
        # Open The Mail Program
        open(MAIL,"|$mailprog");
        print MAIL "To: $Config{'recipient'}\n";
        print MAIL "From: $Config{'email'} ($Config{'realname'})\n";
        # Check for Message Subject
        if ($Config{'subject'}) { print MAIL "Subject: $Config{'subject'}\n\n" }
        else                    { print MAIL "Subject: WWW Form Submission\n\n" }
        print MAIL "Below is the result of your feedback form.  It was submitted by\n";
        print MAIL "$Config{'realname'} ($Config{'email'}) on $date\n";
        print MAIL "-" x 75 . "\n\n";
        if (@Print_Config) {
            foreach $print_config (@Print_Config) {
                if ($Config{$print_config}) {
                    print MAIL "$print_config: $Config{$print_config}\n\n";
        # If a sort order is specified, sort the form fields based on that.      #
        if ($Config{'sort'} =~ /^order:.*,.*/) {
            # Remove extraneous line breaks and spaces, remove the order:        #
            # directive and split the sort fields into an array.                 #
            local $sort_order = $Config{'sort'};
            $sort_order =~ s/(\s+|\n)?,(\s+|\n)?/,/g;
            $sort_order =~ s/(\s+)?\n+(\s+)?//g;
            $sort_order =~ s/order://;
            @sorted_fields = split(/,/, $sort_order);
            # For each sorted field, if it has a value or the print blank        #
            # fields option is turned on print the form field and value.         #
            foreach $sorted_field (@sorted_fields) {
                if ($Config{'print_blank_fields'} || $Form{$sorted_field} ne '') {
                    print MAIL "$sorted_field: $Form{$sorted_field}\n\n";
        # Otherwise, print fields in order they were sent or alphabetically.     #
        else {
            # Sort alphabetically if specified:                                  #
            if ($Config{'sort'} eq 'alphabetic') {
                @Field_Order = sort @Field_Order;
            # For each form field, if it has a value or the print blank          #
            # fields option is turned on print the form field and value.         #
            foreach $field (@Field_Order) {
                if ($Config{'print_blank_fields'} || $Form{$field} ne '') {
                    print MAIL "$field: $Form{$field}\n\n";
        print MAIL "-" x 75 . "\n\n";
        # Send any specified Environment Variables to recipient.                 #
        foreach $env_report (@Env_Report) {
            if ($ENV{$env_report}) {
                print MAIL "$env_report: $ENV{$env_report}\n";
        close (MAIL);
    sub check_email {
        # Initialize local email variable with input to subroutine.              #
        $email = $_[0];
        # If the e-mail address contains:                                        #
        if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ ||
            # the e-mail address contains an invalid syntax.  Or, if the         #
            # syntax does not match the following regular expression pattern     #
            # it fails basic syntax verification.                                #
            $email !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/) {
            # Basic syntax requires:  one or more characters before the @ sign,  #
            # followed by an optional '[', then any number of letters, numbers,  #
            # dashes or periods (valid domain/IP characters) ending in a period  #
            # and then 2 or 3 letters (for domain suffixes) or 1 to 3 numbers    #
            # (for IP addresses).  An ending bracket is also allowed as it is    #
            # valid syntax to have an email address like: user@[255.255.255.0]   #
            # Return a false value, since the e-mail address did not pass valid  #
            # syntax.                                                            #
            return 0;
        else {
            # Return a true value, e-mail verification passed.                   #
            return 1;
    # This was added into v1.91 to further secure the recipients array.  Now, by #
    # default it will assume that valid recipients include only users with       #
    # usernames A-Z, a-z, 0-9, _ and - that match your domain exactly.  If this  #
    # is not what you want, you should read more detailed instructions regarding #
    # the configuration of the @recipients variable in the documentation.        #
    sub fill_recipients {
        local(@domains) = @_;
        local($domain,@return_recips);
        foreach $domain (@domains) {
            if ($domain =~ /^\d+\.\d+\.\d+\.\d+$/) {
                $domain =~ s/\./\\\./g;
                push(@return_recips,'^[\w\-\.]+\@\[' . $domain . '\]');
            else {
                $domain =~ s/\./\\\./g;
                $domain =~ s/\-/\\\-/g;
                push(@return_recips,'^[\w\-\.]+\@' . $domain);
        return @return_recips;
    # This function will convert <, >, & and " to their HTML equivalents.        #
    sub clean_html {
        local $value = $_[0];
        $value =~ s/\&/\&amp;/g;
        $value =~ s/</\&lt;/g;
        $value =~ s/>/\&gt;/g;
        $value =~ s/"/\&quot;/g;
        return $value;
    sub body_attributes {
        # Check for Background Color
        if ($Config{'bgcolor'}) { print " bgcolor=\"$safeConfig{'bgcolor'}\"" }
        # Check for Background Image
        if ($Config{'background'}) { print " background=\"$safeConfig{'background'}\"" }
        # Check for Link Color
        if ($Config{'link_color'}) { print " link=\"$safeConfig{'link_color'}\"" }
        # Check for Visited Link Color
        if ($Config{'vlink_color'}) { print " vlink=\"$safeConfig{'vlink_color'}\"" }
        # Check for Active Link Color
        if ($Config{'alink_color'}) { print " alink=\"$safeConfig{'alink_color'}\"" }
        # Check for Body Text Color
        if ($Config{'text_color'}) { print " text=\"$safeConfig{'text_color'}\"" }
    sub error {
        # Localize variables and assign subroutine input.                        #
        local($error,@error_fields) = @_;
        local($host,$missing_field,$missing_field_list);
        if ($error eq 'bad_referer') {
            if ($ENV{'HTTP_REFERER'} =~ m|^https?://([\w\.]+)|i) {
                $host = $1;
                my $referer = &clean_html($ENV{'HTTP_REFERER'});
                print <<"(END ERROR HTML)";
    Content-type: text/html
    <html>
    <head>
      <title>Bad Referrer - Access Denied</title>
    </head>
    <body bgcolor=#FFFFFF text=#000000>
      <center>
       <table border=0 width=600 bgcolor=#9C9C9C>
        <tr><th><font size=+2>Bad Referrer - Access Denied</font></th></tr>
       </table>
       <table border=0 width=600 bgcolor=#CFCFCF>
        <tr><td>The form attempting to use
         <a href="http://www.scriptarchive.com/formmail.html">FormMail</a>
         resides at <tt>$referer</tt>, which is not allowed to access
         this cgi script.<p>
         If you are attempting to configure FormMail to run with this form, you need
         to add the following to \@referers, explained in detail in the
         <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<p>
         Add <tt>'$host'</tt> to your <tt><b>\@referers</b></tt> array.<hr size=1>
         <center><font size=-1>
          <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
          A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
         </font></center>
        </td></tr>
       </table>
      </center>
    </body>
    </html>
    (END ERROR HTML)
            else {
                print <<"(END ERROR HTML)";
    Content-type: text/html
    <html>
    <head>
      <title>FormMail v1.93</title>
    </head>
    <body bgcolor=#FFFFFF text=#000000>
      <center>
       <table border=0 width=600 bgcolor=#9C9C9C>
        <tr><th><font size=+2>FormMail</font></th></tr>
       </table>
       <table border=0 width=600 bgcolor=#CFCFCF>
        <tr><th><tt><font size=+1>Copyright 1995 - 2009 Matt Wright<br>
            Version 1.93 - Released June 25, 2009<br>
            A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive,
            Inc.</a></font></tt></th></tr>
       </table>
      </center>
    </body>
    </html>
    (END ERROR HTML)
        elsif ($error eq 'request_method') {
                print <<"(END ERROR HTML)";
    Content-type: text/html
    <html>
    <head>
      <title>Error: Request Method</title>
    </head>
    <body bgcolor=#FFFFFF text=#000000>
      <center>
       <table border=0 width=600 bgcolor=#9C9C9C>
        <tr><th><font size=+2>Error: Request Method</font></th></tr>
       </table>
       <table border=0 width=600 bgcolor=#CFCFCF>
        <tr><td>The Request Method of the Form you submitted did not match
         either <tt>GET</tt> or <tt>POST</tt>.  Please check the form and make sure the
         <tt>method=</tt> statement is in upper case and matches <tt>GET</tt> or <tt>POST</tt>.<p>
         <center><font size=-1>
          <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
          A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
         </font></center>
        </td></tr>
       </table>
      </center>
    </body>
    </html>
    (END ERROR HTML)
        elsif ($error eq 'no_recipient') {
                print <<"(END ERROR HTML)";
    Content-type: text/html
    <html>
    <head>
      <title>Error: Bad/No Recipient</title>
    </head>
    <body bgcolor=#FFFFFF text=#000000>
      <center>
       <table border=0 width=600 bgcolor=#9C9C9C>
        <tr><th><font size=+2>Error: Bad/No Recipient</font></th></tr>
       </table>
       <table border=0 width=600 bgcolor=#CFCFCF>
        <tr><td>There was no recipient or an invalid recipient specified in the data sent to FormMail.  Please
         make sure you have filled in the <tt>recipient</tt> form field with an e-mail
         address that has been configured in <tt>\@recipients</tt>.  More information on filling in <tt>recipient</tt> form fields and variables can be
         found in the <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<hr size=1>
         <center><font size=-1>
          <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
          A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
         </font></center>
        </td></tr>
       </table>
      </center>
    </body>
    </html>
    (END ERROR HTML)
        elsif ($error eq 'invalid_headers') {
                print <<"(END ERROR HTML)";
    Content-type: text/html
    <html>
    <head>
      <title>Error: Bad Header Fields</title>
    </head>
    <body bgcolor=#FFFFFF text=#000000>
      <center>
       <table border=0 width=600 bgcolor=#9C9C9C>
        <tr><th><font size=+2>Error: Bad Header Fields</font></th></tr>
       </table>
       <table border=0 width=600 bgcolor=#CFCFCF>
        <tr><td>The header fields, which include <tt>recipient</tt>, <tt>email</tt>, <tt>realname</tt> and <tt>subject</tt> were
         filled in with invalid values. You may not include any newline characters in these parameters.
         More information on filling in these form fields and variables can be
         found in the <a href="http://www.scriptarchive.com/readme/formmail.html">README</a> file.<hr size=1>
         <center><font size=-1>
          <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
          A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
         </font></center>
        </td></tr>
       </table>
      </center>
    </body>
    </html>
    (END ERROR HTML)
        elsif ($error eq 'missing_fields') {
            if ($Config{'missing_fields_redirect'}) {
                print "Location: " . &clean_html($Config{'missing_fields_redirect'}) . "\n\n";
            else {
                foreach $missing_field (@error_fields) {
                    $missing_field_list .= "<li>" . &clean_html($missing_field) . "\n";
                print <<"(END ERROR HTML)";
    Content-type: text/html
    <html>
    <head>
      <title>Error: Blank Fields</title>
    </head>
      <center>
       <table border=0 width=600 bgcolor=#9C9C9C>
        <tr><th><font size=+2>Error: Blank Fields</font></th></tr>
       </table>
       <table border=0 width=600 bgcolor=#CFCFCF>
        <tr><td>The following fields were left blank in your submission form:<p>
         <ul>
    $missing_field_list
         </ul><br>
         These fields must be filled in before you can successfully submit the form.<p>
         Please use your browser's back button to return to the form and try again.<hr size=1>
         <center><font size=-1>
          <a href="http://www.scriptarchive.com/formmail.html">FormMail</a> V1.93 &copy; 1995 - 2009  Matt Wright<br>
          A Free Product of <a href="http://www.scriptarchive.com/">Matt's Script Archive, Inc.</a>
         </font></center>
        </td></tr>
       </table>
      </center>
    </body>
    </html>
    (END ERROR HTML)
        exit;

    I haven't used  Matt Wright's scripts in this century, but I'm pretty sure that Perl still needs to go into your CGI bin and the permissions level (chmod) must be set to 755 or possibly 777 for the script to read, write & execute.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • My  PHP  form no longer works?

    Hi
    http://www.collegestudentvoice.com/form/form.php
    1. Programmer says there is no coding errors.  Nothing has changed.
    2. Host says there must be coding errors.
    3. There may version incompetibilities with Perl script between the form and the host version.
    these are 3 files:
    Sendform:
    <?php
    // Pear library includes
    // You should have the pear lib installed
    include_once('Mail.php');
    include_once('Mail/mime.php');
    //Settings
    $max_allowed_file_size = 10000000; // size in KB
    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp");
    $upload_folder = 'files/'; //<-- this folder must be writeable by the script
    $your_email = '[email protected]';//<<--  update this to your email address
    $errors ='';
    if(isset($_POST['submit']))
        //Get the uploaded file information
        $name_of_uploaded_file =  basename($_FILES['uploaded_file']['name']);
        //get the file extension of the file
        $type_of_uploaded_file = substr($name_of_uploaded_file,
                                strrpos($name_of_uploaded_file, '.') + 1);
        $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;
        ///------------Do Validations-------------
        if(empty($_POST['name'])||empty($_POST['email']))
            $errors .= "\n Name and Email are required fields. ";   
        if(IsInjected($visitor_email))
            $errors .= "\n Bad email value!";
        if($size_of_uploaded_file > $max_allowed_file_size )
            $errors .= "\n Size of file should be less than $max_allowed_file_size";
        //------ Validate the file extension -----
        $allowed_ext = false;
        for($i=0; $i<sizeof($allowed_extensions); $i++)
            if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0)
                $allowed_ext = true;       
        if(!$allowed_ext)
            $errors .= "\n The uploaded file is not supported file type. ".
            " Only the following file types are supported: ".implode(',',$allowed_extensions);
        //send the email
        if(empty($errors))
            //copy the temp. uploaded file to uploads folder
            $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file;
            $tmp_path = $_FILES["uploaded_file"]["tmp_name"];
            if(is_uploaded_file($tmp_path))
                if(!copy($tmp_path,$path_of_uploaded_file))
                    $errors .= '\n error while copying the uploaded file';
            //send the email
            $name = $_POST['name'];
            $visitor_email = $_POST['email'];
            $user_message = $_POST['message'];
            $to = $your_email;
            $subject="New form submission";
            $from = $your_email;
            $text = "A user  $name has sent you this message:\n $user_message";
            $message = new Mail_mime();
            $message->setTXTBody($text);
            $message->addAttachment($path_of_uploaded_file);
            $body = $message->get();
            $extraheaders = array("From"=>$from, "Subject"=>$subject,"Reply-To"=>$visitor_email);
            $headers = $message->headers($extraheaders);
            $mail = Mail::factory("mail");
            $mail->send($to, $headers, $body);
            //redirect to 'thank-you page
            header('Location: thank-you.html');
    ///////////////////////////Functions/////////////////
    // Function to validate against any email injection attempts
    function IsInjected($str)
      $injections = array('(\n+)',
                  '(\r+)',
                  '(\t+)',
                  '(%0A+)',
                  '(%0D+)',
                  '(%08+)',
                  '(%09+)'
      $inject = join('|', $injections);
      $inject = "/$inject/i";
      if(preg_match($inject,$str))
        return true;
      else
        return false;
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
        <title>File upload form</title>
    <!-- define some style elements-->
    <style>
    label,a, body
        font-family : Arial, Helvetica, sans-serif;
        font-size : 12px;
    </style>   
    <!-- a helper script for vaidating the form-->
    <script language="JavaScript" src="scripts/gen_validatorv31.js" type="text/javascript"></script>   
    </head>
    <body>
    <?php
    if(!empty($errors))
        echo nl2br($errors);
    ?>
    <form method="POST" name="email_form_with_php"
    action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" enctype="multipart/form-data">
    <p>
    <label for='name'>Name: </label><br>
    <input type="text" name="name" >
    </p>
    <p>
    <label for='email'>Email: </label><br>
    <input type="text" name="email" >
    </p>
    <p>
    <label for='message'>Message:</label> <br>
    <textarea name="message"></textarea>
    </p>
    <p>
    <label for='uploaded_file'>Select A File To Upload:</label> <br>
    <input type="file" name="uploaded_file">
    </p>
    <input type="submit" value="Submit" name='submit'>
    </form>
    <script language="JavaScript">
    // Code for validating the form
    // Visit http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
    // for details
    var frmvalidator  = new Validator("email_form_with_php");
    frmvalidator.addValidation("name","req","Please provide your name");
    frmvalidator.addValidation("email","req","Please provide your email");
    frmvalidator.addValidation("email","email","Please enter a valid email address");
    </script>
    <noscript>
    <small><a href='http://www.html-form-guide.com/email-form/php-email-form-attachment.html'
    >How to attach file to email in PHP</a> article page.</small>
    </noscript>
    </body>
    </html>
    FORM:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>College Student</title>
    <link rel="stylesheet" type="text/css" href="css/view.css" media="all">
    <script type="text/javascript" src="js/view.js"></script>
    <script src="js/forms.js" type="text/javascript"></script>
    </head>
    <body id="main_body" >
        <div id="form_container">
    <form action="formaction.php" method="post" enctype="multipart/form-data" name="contactus" id="contactus"  style="border:none;" onsubmit="return validateForm()">
                        <div class="form_description">
                <h2><img src="CSVlogo.GIF" width="269" height="97" alt="Logo" /></h2>
                <p>Please type in your first and last names along with our school email address (i.e., [email protected]) when submitting your articles or photographs.</p>
    <p>Select the category that best describes the subject of  your article or photograph. (i.e., Business, Politics, Sports, Humor, etc.)</p>
    <p>When writing about a sporting event please include the name of the sport in the ‘Subject’ line of your email along with the date of the event and the names of the teams. (i.e., Basketball 01-15-11 L.A. Lakers vs.Detroit Pistons)</p>
            </div>       
            <div>
                    <?php
    if (isset($_GET['suc'])) {
    echo "<div style='color:#F00; padding:15px; display:block; margin:10px 0 10px 0;'> ";
    echo "Thank you for your submission!";
    echo "</div>";
    } else {
    ?>
    </div>
                <ul >
                        <li id="li_5" >
            <label class="description" for="Business">Business </label>
            <div>
            <select class="element select medium" name="Business">
                <option value="" selected="selected"></option>
    <option value="Classified" >Classified</option>
    <option value="careertips" >Career Tip</option>
            </select>
            </div>
            </li>        <li id="li_6" >
            <label class="description" for="ProfessionalSports">Professional Sports </label>
            <div>
            <select class="element select medium" name="ProfessionalSports">
                <option value="" selected="selected"></option>
    <option value="NBA" >NBA</option>
    <option value="NFL" >NFL</option>
    <option value="MLB" >MLB</option>
    <option value="otherprosports" >Other</option>
            </select>
            </div>
            </li>        <li id="li_7" >
            <label class="description" for="Humor101">Humor 101</label>
            <div>
            <select class="element select medium" name="Humor101">
                <option value="" selected="selected"></option>
    <option value="Cartoons" >Cartoons</option>
    <option value="Jokes" >Jokes</option>
    <option value="Stories" >Stories</option>
    <option value="Photographs" >Photographs</option>
            </select>
            </div>
            </li>        <li id="li_8" >
            <label class="description" for="CollegeSports">College Sports</label>
            <div>
            <select class="element select medium" name="CollegeSports">
                <option value="" selected="selected"></option>
    <option value="basketballcollege" >Basketball</option>
    <option value="baseballcollege" >Baseball</option>
    <option value="Footballcollege" >Football</option>
    <option value="Softball" >Softball</option>
    <option value="othercollege" >Other</option>
            </select>
            </div>
            </li>        <li id="li_9" >
            <label class="description" for="Politics">Politics</label>
            <div>
            <select class="element select medium" name="Politics">
                <option value="" selected="selected"></option>
    <option value="statelocal" >State/Local</option>
    <option value="National" >National</option>
    <option value="World" >World</option>
            </select>
            </div>
            </li>        <li id="li_1" >
            <label class="description" for="element_1">Name </label>
            <span>
                <input id="First" name="First" class="element text" maxlength="255" size="40" value=""/>
                <label>First</label>
            </span>
            <span>
                <input id="Last" name= "Last" class="element text" maxlength="255" size="40" value=""/>
                <label>Last</label>
            </span>
            </li>       
            <li id="li_sub" >
            <label class="description" for="Subject">Subject </label>
            <div>
                <input id="Subject" name="Subject" class="element text medium required" type="text" maxlength="255" value=""/>
            </div>
            </li>   
            <li id="li_2" >
            <label class="description" for="Email">Email </label>
            <div>
                <input id="Email" name="Email" class="element text medium required email" type="text" maxlength="255" value=""/>
            </div>
            </li>        <li id="li_3" >
            <label class="description" for="EmailC">Confirm Email </label>
            <div>
                <input id="EmailC" name="EmailC" class="element text medium" type="text" maxlength="255" value=""/>
            </div>
            </li>        <li id="li_4" >
            <label class="description" for="Suggestions">Suggestions </label>
            <div>
                <textarea id="Suggestions" name="Suggestions" class="element textarea medium"></textarea>
            </div>
            </li>
          <li id="li_5" >
            <label class="description" for="Upload">Upload File </label>
    <input type="file" name="uploaded_file">
            <div>
              </div>
            </li>
            <li id="li_6" >
            <label class="description" for="Upload">Are you human?</label>
            <?php
            require_once('recaptchalib.php');
              $publickey = "6LfwwsISAAAAAA7UTKJcDATLiK-e55gPFW1Opfrq"; // you got this from the signup page
              echo recaptcha_get_html($publickey);
            ?>
            <div>
              </div>
            </li>
                        <li class="buttons">
                    <input type="submit" name="Submit" value="Submit" class="button" />
    </li>
                </ul>
    </form>
    <!--        <div id="footer">
            </div>
    -->    </div>
    </body>
    </html>
    FORMACTION
    <?php
      require_once('recaptchalib.php');
    $privatekey = "6LfwwsISAAAAAAPShkJ6nV3qkgLDHCe2uXj9RTWw";
      $resp = recaptcha_check_answer ($privatekey,
                                    $_SERVER["REMOTE_ADDR"],
                                    $_POST["recaptcha_challenge_field"],
                                    $_POST["recaptcha_response_field"]);
      if (!$resp->is_valid) {
        die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
      else {
    include_once('Mail.php');
    include_once('Mail/mime.php');
    $errors ='';
    $max_allowed_file_size = 10000000; // size in KB
    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp");
    $upload_folder = 'files/';
        $name_of_uploaded_file =  basename($_FILES['uploaded_file']['name']);
        $type_of_uploaded_file = substr($name_of_uploaded_file,
                                strrpos($name_of_uploaded_file, '.') + 1);
        $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;
        if($size_of_uploaded_file > $max_allowed_file_size )
            $errors .= "\n Size of file should be less than $max_allowed_file_size";
        $allowed_ext = false;
        for($i=0; $i<sizeof($allowed_extensions); $i++)
            if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0)
                $allowed_ext = true;       
        if(!$allowed_ext)
            $errors .= "\n The uploaded file is not supported file type. ".
            " Only the following file types are supported: ".implode(',',$allowed_extensions);
        if(empty($errors))
            $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file;
            $tmp_path = $_FILES["uploaded_file"]["tmp_name"];
            if(is_uploaded_file($tmp_path))
                if(!copy($tmp_path,$path_of_uploaded_file))
                    $errors .= '\n error while copying the uploaded file';
            $Business = Trim(stripslashes($_POST['Business']));
            $ProfessionalSports = Trim(stripslashes($_POST['ProfessionalSports']));
            $Humor101 = Trim(stripslashes($_POST['Humor101']));
            $CollegeSports = Trim(stripslashes($_POST['CollegeSports']));
            $Politics = Trim(stripslashes($_POST['Politics']));
            $EmailToBusiness = $Business . "@collegestudentvoice.net";
            $EmailToProfessionalSports = $ProfessionalSports . "@collegestudentvoice.net";
            $EmailToHumor101 =  $Humor101 ."@collegestudentvoice.net";
            $EmailToCollegeSports = $CollegeSports . "@collegestudentvoice.net";
            $EmailToPolitics = $Politics . "@collegestudentvoice.net";
            $EmailTo = "[email protected]";
            $EMailSubject = Trim(stripslashes($_POST['Subject']));
            $First = Trim(stripslashes($_POST['First']));
            $Last = Trim(stripslashes($_POST['Last']));
            $Email = Trim(stripslashes($_POST['Email']));
            $Suggestions = Trim(stripslashes($_POST['Suggestions']));
            $Body = "The following form has been filled";
            $Body .= "\n";
            $Body .= "---------------------------------------------------------------------------------";
            $Body .= "\n";
            $Body .= "\n";
            $Body .= "First Name: ";
            $Body .= $First;
            $Body .= "\n";
            $Body .= "Last Name: ";
            $Body .= $Last;
            $Body .= "\n";
            $Body .= "Email: ";
            $Body .= $Email;
            $Body .= "\n";
            $Body .= "Business: ";
            $Body .= $Business;
            $Body .= "\n";
            $Body .= "Professional Sports: ";
            $Body .= $ProfessionalSports;
            $Body .= "\n";
            $Body .= "Humor 101: ";
            $Body .= $Humor101;
            $Body .= "\n";
            $Body .= "College Sports: ";
            $Body .= $CollegeSports;
            $Body .= "\n";
            $Body .= "Politics: ";
            $Body .= $Politics;
            $Body .= "\n";
            $Body .= "Suggestions: ";
            $Body .= $Suggestions;
            $Body .= "\n";
            $Body .= "\n";
            $Body .= "---------------------------------------------------------------------------------\n";
            $Body .= "Emails sent to: " . strtolower($EmailToBusiness) . " / " .strtolower($EmailToProfessionalSports). " / " .strtolower($EmailToHumor101). " / " .strtolower($EmailToCollegeSports). " / ".strtolower($EmailToPolitics). "";
            $to = "[email protected]";
            $subject= $EMailSubject;
            $from = "[email protected]";
            $text = "\n $Body";
            $message = new Mail_mime();
            $message->setTXTBody($text);
            $message->addAttachment($path_of_uploaded_file);
            $body = $message->get();
            $extraheaders = array("From"=>$from, "Subject"=>$subject,"Reply-To"=>$Email);
            $headers = $message->headers($extraheaders);
            $mail = Mail::factory("mail");
            $mail->send($to, $headers, $body);
            if ($Business != "")
                        $mail->send(strtolower($EmailToBusiness), $headers, $body);
            if ($ProfessionalSports != "")
                        $mail->send(strtolower($EmailToProfessionalSports), $headers, $body);
            if ($Humor101 != "")
                        $mail->send(strtolower($EmailToHumor101), $headers, $body);
            if ($CollegeSports != "")
                        $mail->send(strtolower($EmailToCollegeSports), $headers, $body);
            if ($Politics != "")
                        $mail->send(strtolower($EmailToPolitics), $headers, $body);
            print "<meta http-equiv=\"refresh\" content=\"0;URL=form.php?suc=y\">";
    ?>

    bregent,
    you have explained everything was is happening.
    Mine firewall setttings block the scrip so when I fill the form and submit it, I do not get any errors, but that form information does not go anywhere.
    All firewall setting should be OFF  when a form is submitted?
    dreamweavewr101.1

  • cfif form.secret_word EQ #session.secretWord# thank you  cfelse sorry /cfif  

    If users enter the secret_word which coincides with the
    session.secretWord then the form can continue and do its
    validating. If not the form stops and the cfelse message is shown.
    The cfif code is here:
    <cfif form.secret_word EQ #session.secretWord#>
    Thank you for your message.
    <cfelse>
    Sorry, the secret word you entered in the field does not
    match the word in the image
    Please hit your back button</cfif>
    My actionpage is here and I would be very greatful if someone
    could show me where the cfif should go. Thanks:
    <cfinclude template="topnav.cfm">
    <!--- Must create this default structure or we pull an
    error --->
    <cfparam name="session.contact_nfo" default="">
    <cfif NOT IsStruct(session.contact_nfo)>
    <cfset session.contact_nfo = StructNew()>
    </cfif>
    <!-- Now we create default variable using cfparam -->
    <cfparam name="Form.terms" default="NO">
    <cfparam name="session.contact_nfo.Name" default="">
    <cfparam name="Form.Country" default="">
    <cfparam name="Form.City" default="">
    <cfparam name="Form.Telephone" default="">
    <cfparam name="session.contact_nfo.email" default="">
    <cfparam name="session.contact_nfo.comments"
    default="">
    <!-- Now we clear the Session of any Values to allow us to
    place our new form Values passed from our form page -->
    <cfset StructClear(session.contact_nfo)>
    <!-- Now we are placing our Form Values into the Session
    -->
    <cfset session.contact_nfo.terms= form.terms>
    <cfset session.contact_nfo.Name= form.Name>
    <cfset session.contact_nfo.email= form.email>
    <cfset session.contact_nfo.comments= form.comments>
    <!-- Now we are going to do our Error Checking first off
    by creating a value of nothing for the variable we are calling
    Errors -->
    <cfparam name="errors" type="string" default="">
    <!-- As we check for Errors if we find one we place it in
    our List to display to our user making it easy for the end-user to
    correct as they can see the error -->
    <!-- Notice we are not validating the checkbox as it is
    not a required form field -->
    <cfif form.Name EQ "">
    <cfset errors = errors & "<li>You Forgot to
    enter your name!</li>">
    </cfif>
    <!-- Checking the email is a little more complicated so we
    use a regular expression to check and see if there is a email
    address and also is it formed properly -->
    <cfif NOT
    REFindnocase("^[-_!a-z0-9\.]+@([-_a-z0-9]+\.)+[a-z]{2,6}$",
    email)>
    <cfset errors = errors & "<li
    class=""errors"">Your Email Address seems
    incorrect?</li>">
    </cfif>
    <cfif form.comments EQ "">
    <cfset errors = errors & "<li
    class=""errors"">You Forgot to enter a comment!</li>">
    </cfif>
    <cfif errors NEQ "">
    <!-- Here we are collecting the Error Message generated
    by our code and placing them into a list for the user to see -->
    <TABLE class="label1" WIDTH="300" BORDER="0"
    CELLSPACING="0" CELLPADDING="0" ALIGN="Center">
    <TR><P> <TD ALIGN="Left" VALIGN="Top">You
    have some errors in your form submission, please try
    again<br>
    <cfoutput>#errors#</cfoutput></td></P>
    </tr>
    </table>
    <!-- Also take note that the form action is now different
    in that it is carrying the applications session with it which we
    need to make our Application.cfm file work with the action. -->
    <cfoutput>
    <form method="post"
    action="action_form.cfm?#session.UrlToken#">
    <P><TABLE class="label1" WIDTH="300" BORDER="0"
    CELLSPACING="0" CELLPADDING="0" ALIGN="Center">
    <TR> <TD ALIGN="Left" VALIGN="Top">
    <!-- This is how we place our session values into the
    form field also important to note the because we used cfparam in
    the start of this page to assign a default value of "" if there was
    no value originally entered in the form than it will show no value
    here. If we did not use the cfparam tag we would now show an error
    as the session would go looking for a non-existant value -->
    <P>Name: [*]<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="Name"
    SIZE="40" value="#session.contact_nfo.Name#"></P>
    <P>Country:<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="Country"
    SIZE="40" value="#Form.Country#"></P>
    <P>City:<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="City"
    SIZE="40" value="#Form.City#"></P>
    <P>Telephone:<br>
    <INPUT TYPE="Text" class="ftforminputsmall"
    NAME="Telephone" SIZE="40" value="#Form.Telephone#"></P>
    <P>E-mail: [*]<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="Email"
    SIZE="40" value="#session.contact_nfo.email#"></P>
    </P>
    <P>Comments: [*]<BR>
    <textarea cols="40" size="40" class="ftforminputsmall"
    rows="2"
    name="comments">#session.contact_nfo.comments#</textarea></P>
    <P>Booking dates:<br>
    <P>From:
    <select name="day" class="ftforminputsmall">
    <cfloop from="1" to="31" index="i">
    <option value="#i#"
    selected="selected">#form.day#</option>
    </cfloop>
    </select>
    <cfset monthList =
    "January,February,March,April,May,June,July,August,September,October,November,December"
    />
    <select name="month" class="ftforminputsmall">
    <cfloop list="#monthList#" index="m"> <option
    value="#m#"
    selected="selected">#form.month#</option></cfloop>
    </select>
    <select name="year" class="ftforminputsmall">
    <cfloop from="2006" to="2020" index="i">
    <option value="#i#">#form.year#</option>
    </cfloop>
    </select>
    </P>
    <P>To:
    <select name="dayto" class="ftforminputsmall">
    <cfloop from="1" to="31" index="i">
    <option value="#i#"
    selected="selected">#form.dayto#</option>
    </cfloop>
    </select>
    <cfset monthList =
    "January,February,March,April,May,June,July,August,September,October,November,December"
    />
    <select name="monthto" class="ftforminputsmall">
    <cfloop list="#monthList#" index="m"> <option
    value="#m#"
    selected="selected">#form.monthto#</option></cfloop>
    </select>
    <select name="yearto" class="ftforminputsmall">
    <cfloop from="2006" to="2020" index="i">
    <option value="#i#"
    selected="selected">#form.yearto#</option>
    </cfloop>
    </select>
    <P>
    <input name="Submit" type="submit"
    CLASS="ftforminputsmall" value="Submit">
    </P>
    </table>
    </form>
    </cfoutput>
    <!-- If no errors were detected we abort the previous code
    and show the next code section -->
    <cfabort>
    </cfif></td></tr>

    Right I´ve put in the cfparams and the cfif at the top
    of the page after the cfinclude.
    However if the word is wrong the page still executes which it
    shouldn´t. It is confusing with all the cfifs but if the
    secret word is wrong the "sorry" message should be shown and the
    page stops (maybe I need cfabort or cfexit?) The message is being
    shown but the page continues. Here is the code:
    <cfinclude template="topnav.cfm">
    <cfparam name="session.secretWord" default="">
    <cfparam name="Form.secret_word" default="">
    <cfif form.secret_word EQ #session.secretWord#>
    Thank you for your message.
    <cfelse>
    Sorry, the secret word you entered in the field does not
    match the word in the image
    Please hit your back button</cfif>
    <!--- Must create this default structure or we pull an
    error --->
    <cfparam name="session.contact_nfo" default="">
    <cfif NOT IsStruct(session.contact_nfo)>
    <cfset session.contact_nfo = StructNew()>
    </cfif>
    <!-- Now we create default variable using cfparam -->
    <cfparam name="Form.terms" default="NO">
    <cfparam name="session.contact_nfo.Name" default="">
    <cfparam name="Form.Country" default="">
    <cfparam name="Form.City" default="">
    <cfparam name="Form.Telephone" default="">
    <cfparam name="session.contact_nfo.email" default="">
    <cfparam name="session.contact_nfo.comments"
    default="">
    <!-- Now we clear the Session of any Values to allow us to
    place our new form Values passed from our form page -->
    <cfset StructClear(session.contact_nfo)>
    <!-- Now we are placing our Form Values into the Session
    -->
    <cfset session.contact_nfo.terms= form.terms>
    <cfset session.contact_nfo.Name= form.Name>
    <cfset session.contact_nfo.email= form.email>
    <cfset session.contact_nfo.comments= form.comments>
    <cfparam name="errors" type="string" default="">
    <cfif form.Name EQ "">
    <cfset errors = errors & "<li>You Forgot to
    enter your name!</li>">
    </cfif>
    <cfif NOT
    REFindnocase("^[-_!a-z0-9\.]+@([-_a-z0-9]+\.)+[a-z]{2,6}$",
    email)>
    <cfset errors = errors & "<li
    class=""errors"">Your Email Address seems
    incorrect?</li>">
    </cfif>
    <cfif form.comments EQ "">
    <cfset errors = errors & "<li
    class=""errors"">You Forgot to enter a comment!</li>">
    </cfif>
    <cfif errors NEQ "">
    <!-- Here we are collecting the Error Message generated
    by our code and placing them into a list for the user to see -->
    <TABLE class="label1" WIDTH="300" BORDER="0"
    CELLSPACING="0" CELLPADDING="0" ALIGN="Center">
    <TR><P> <TD ALIGN="Left" VALIGN="Top">You
    have some errors in your form submission, please try
    again<br>
    <cfoutput>#errors#</cfoutput></td></P>
    </tr>
    </table>
    <!-- basically the same form we used in form.cfm -->
    <cfoutput>
    <form method="post"
    action="action_form.cfm?#session.UrlToken#">
    <P><TABLE class="label1" WIDTH="300" BORDER="0"
    CELLSPACING="0" CELLPADDING="0" ALIGN="Center">
    <TR> <TD ALIGN="Left" VALIGN="Top">
    <P>Name: [*]<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="Name"
    SIZE="40" value="#session.contact_nfo.Name#"></P>
    <P>Country:<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="Country"
    SIZE="40" value="#Form.Country#"></P>
    <P>City:<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="City"
    SIZE="40" value="#Form.City#"></P>
    <P>Telephone:<br>
    <INPUT TYPE="Text" class="ftforminputsmall"
    NAME="Telephone" SIZE="40" value="#Form.Telephone#"></P>
    <P>E-mail: [*]<br>
    <INPUT TYPE="Text" class="ftforminputsmall" NAME="Email"
    SIZE="40" value="#session.contact_nfo.email#"></P>
    </P>
    <P>Secret word: [*]<br>
    <cfinvoke webservice="
    http://www.easycfm.com/webservices/captcha.cfc?wsdl"
    method="generateCaptcha"
    returnvariable="easyCaptcha">
    <cfinvokeargument name="height" value="100"/>
    <cfinvokeargument name="YPos" value="20"/>
    </cfinvoke> </P>
    <P><cfset session.secretWord =
    easyCaptcha.CAPTCHAWORD>
    <cfoutput>
    <img src="#easyCaptcha.IMAGE#"
    border="0"></cfoutput></P>
    <P><div="label1"> Please retype the Secret Word
    in the field below. This is a simple security
    matter to protect the information we receive through this
    form.</div></P>
    <P>
    <INPUT TYPE="Text" class="ftforminputsmall"
    NAME="secret_word" SIZE="40"></P>
    <P>Comments: [*]<BR>
    <textarea cols="40" size="40" class="ftforminputsmall"
    rows="2"
    name="comments">#session.contact_nfo.comments#</textarea></P>
    <P>Booking dates:<br>
    <P>From:
    <select name="day" class="ftforminputsmall">
    <cfloop from="1" to="31" index="i">
    <option value="#i#"
    selected="selected">#form.day#</option>
    </cfloop>
    </select>
    <cfset monthList =
    "January,February,March,April,May,June,July,August,September,October,November,December"
    />
    <select name="month" class="ftforminputsmall">
    <cfloop list="#monthList#" index="m"> <option
    value="#m#"
    selected="selected">#form.month#</option></cfloop>
    </select>
    <select name="year" class="ftforminputsmall">
    <cfloop from="2006" to="2020" index="i">
    <option value="#i#">#form.year#</option>
    </cfloop>
    </select>
    </P>
    <P>To:
    <select name="dayto" class="ftforminputsmall">
    <cfloop from="1" to="31" index="i">
    <option value="#i#"
    selected="selected">#form.dayto#</option>
    </cfloop>
    </select>
    <cfset monthList =
    "January,February,March,April,May,June,July,August,September,October,November,December"
    />
    <select name="monthto" class="ftforminputsmall">
    <cfloop list="#monthList#" index="m"> <option
    value="#m#"
    selected="selected">#form.monthto#</option></cfloop>
    </select>
    <select name="yearto" class="ftforminputsmall">
    <cfloop from="2006" to="2020" index="i">
    <option value="#i#"
    selected="selected">#form.yearto#</option>
    </cfloop>
    </select>
    <P>
    <input name="Submit" type="submit"
    CLASS="ftforminputsmall" value="Submit">
    </P>
    </table>
    </form>
    </cfoutput>
    <!-- If no errors were detected we abort the previous code
    and show the next code section -->
    <cfabort>
    </cfif></td></tr>
    <!-- In this next section we can now take our form values
    and do what ever we decide to do with them i.e. mailing them to
    ourselves, placing them into a database, or a combination of both.
    In this section it is wise to let the user know that his
    information has been received as coldfusion has no way of letting
    them know ---->
    <cfmail server="" username="" password="" to="" from=""
    subject="" type="">
    <table><tr>
    <td align="center" bgcolor="##006600"
    class="ftbody"><span class="ftbody2"><strong
    class="label1">Telephone:
    </strong></span></td>
    <td align="center" bgcolor="##006600"
    class="ftbody"><span class="ftbody2"><strong
    class="label1"><cfoutput>#Trim(FORM.name)#</cfoutput></strong></span></td>
    </tr></cfmail>

  • Site messed up after adding Contact form.

    The site is online in its current state: http://www.wientjesvoegwerk.nl/index.html
    The site uses (X)HTML, JAVA, PHP and Spry tabbed panels with a CSS layout.
    The current state has:
    <?php include("mail.php"); ?>
    Before the Doctype, etc.
    <?php $xajax->printJavascript('xajax/'); ?>
    In the header.
    But adding:
    <?php echo '<div id="contact_result">'.$form.'</div>'; ?>
    to the div where i want to put the mailing form results in problems...
    If i add that last line my footer will go up to the header. and i dont know why...
    The new code from the form that messes up the site is marked in red.
    The HTML:
    <?php include("mail.php"); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
         <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
         <title>Wientjes Voegwerk & Renovatie - Home</title>
        <link href="CSS/Style.css" rel="stylesheet" type="text/css" />
         <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
         <link href="CSS/Style.css" rel="stylesheet" type="text/css" />
         <meta http-equiv="Content-Language" content="NL" />
         <meta http-equiv="imagetoolbar" content="no" />
         <meta name="MSSmartTagsPreventParsing" content="true" />
        <meta name="description" content="Wientjes Voegwerk en Renovatie is een voeg- en renovatiebedrijf gespecialiseerd in gevelrenovatie. Dagelijkse werkzaamheden zijn het voegen van nieuwbouwwerk, en alle voorkomende vormen van gevelrenovatie. Ik geef uw woning, garage of schoorsteen de aandacht die het verdient en ben trots op het resultaat van mijn werk!"/>
        <meta name="keywords" content="Voegwerk, Renovatie, Reinigen, Impregneren, Muur, Voegen, Steen, Woning, Garage, Schoorsteen, Bedrijf, Gevel, Wientjes, Uitslijten, Kappen, Fundering, Vorstschade, Metselen, Metselwerk, Vocht" />
        <meta name="author" content="Rob Nijlaan" />
        <?php $xajax->printJavascript('xajax/'); ?>
    </head>
    <body>
    <div id="WContainer">
      <div id="WHeader" align="center">
             <img src="Pictures/VoegenRenLos.png" width="540" height="58" /><br />
        <img src="Pictures/WientLogo.png" width="600" height="136" alt="Wientjes Voegwerk &amp; Renovatie" /></div>
         <div id="TabbedPanels1" class="VTabbedPanels">
              <ul class="TabbedPanelsTabGroup">
             <div class="TabbedPanelsTab" tabindex="0">
              <style>#Home a{display:block;color:transparent;} #Home a:hover{background-position:left bottom;}a#Home {display:none}</style>
              <table id="Home" width=0 cellpadding=0 cellspacing=0 border=0><tr>
              <td style="padding-right:0px" title ="Home">
            <a href="javascript:TabbedPanels1.showPanel(1);" title="Home" style="background-image:url(Buttons/Home.png);width:172px;height:75px;display:block;"><br/></a></td>
              </tr></table>
              </div>
             <div class="TabbedPanelsTab" tabindex="0">
              <style>#Info a{display:block;color:transparent;} #Info a:hover{background-position:left bottom;}a#Info {display:none}</style>
              <table id="Info" width=0 cellpadding=0 cellspacing=0 border=0><tr>
              <td style="padding-right:0px" title ="Info">
              <a href="javascript:TabbedPanels1.showPanel(2);" title="Info" style="background-image:url(Buttons/Info.png);width:172px;height:75px;display:block;"><br/></a></td>
              </tr></table>
              </div>
             <div class="TabbedPanelsTab" tabindex="0">
              <style>#Gallerij a{display:block;color:transparent;} #Gallerij a:hover{background-position:left bottom;}a#Gallerij {display:none}</style>
              <table id="Gallerij" width=0 cellpadding=0 cellspacing=0 border=0><tr>
              <td style="padding-right:0px" title ="Gallerij">
              <a href="javascript:TabbedPanels1.showPanel(3);" title="Gallerij" style="background-image:url(Buttons/Gallerij.png);width:172px;height:75px;display:block;"><br/></a></td>
              </tr></table>
            </div>
              <div class="TabbedPanelsTab" tabindex="0">
              <style>#Contact a{display:block;color:transparent;} #Contact a:hover{background-position:left bottom;}a#Contact {display:none}</style>
              <table id="Contact" width=0 cellpadding=0 cellspacing=0 border=0><tr>
              <td style="padding-right:0px" title ="Contact">
              <a href="javascript:TabbedPanels1.showPanel(4);" title="Contact" style="background-image:url(Buttons/Contact.png);width:172px;height:75px;display:block;"><br/></a></td>
              </tr></table>
            </div>
            <br />
            <br />
            <br />
            <br />
            <br />
            <center><footer>Wientjes Voegwerk en Renovatie<br /><br />
            tel; 06 - 221 464 28<br /><br />kvk;
            </footer></center>
            </ul>
                     <div class="TabbedPanelsContentGroup">
                        <div class="TabbedPanelsContent" id="Home">
                       <h1>Welkom Bij Wientjes Voegwerk en Renovatie!</h1>
          <p>Wientjes Voegwerk en Renovatie is een voeg- en renovatiebedrijf gespecialiseerd in gevelrenovatie.<br />Dagelijkse werkzaamheden zijn het voegen van nieuwbouwwerk, en alle voorkomende vormen van gevelrenovatie.<br />Ik geef uw woning, garage of schoorsteen de aandacht die het verdient en ben trots op het resultaat van mijn werk!<br /><br />Wientjes, J </p>
          <h2>Voegen/Renovatie/Reinigen & Impregneren. </h2>
    <table border="0" align="right"><center><tr><td>
    <a href="Foto/Foto's telefoon1 075.jpg"><img src="Foto/Foto's telefoon1 075.jpg" alt="Muur met Steiger" width="379" height="354" align="right" margin-right="55px"/>
    </a></td></tr><tr><td><center>klik op de foto voor een groter voorbeeld</center></td></tr></center></table>
      <p>Vaak wordt er bij het kopen van een woning weinig aandacht besteed aan het voegwerk. Er wordt alleen gekeken naar hoe een woning is gebouwd.<br />Een voeg bepaalt echter wel het aanzicht van een woning. Van een goed aangebrachte voeg heeft u uiteraard veel langer plezier. <br />Renovatie bestaat voornamelijk uit het uitslijpen of kappen van het oude voegwerk. Waar nodig het verwijderen van scheuren die zijn ontstaan door:</p>
      <ul>
        <li>
          <p>
            Verzakking van de fundering
          </p>
        </li>
        <li>
          <p>
            Slecht voegwerk
          </p>
        </li>
        <li>
          <p>
            Vorstschade
          </p>
        </li>
        <li>
          <p>
            Doorhangen of ontbreken van ...
          </p>
        </li>
      </ul>
      <p>Bij gevelvervuiling van uw woning kunnen er problemen ontstaan die het wooncomfort negatief kunnen beïnvloeden.<br />Wanneer de voeg is aangetast of het metselwerk is door vorstschade beschadigd, kunnen er vochtproblemen in huis ontstaan.<br />Mos en alg hechten zich goed aan beschadigde stenen en voegwerk. <br /><br />Door middel van impregnering wordt een woning waterafstotend gemaakt.<br />Dit betekent dat het voeg- en metstelwerk jarenlang wordt beschermd tegen weersinvloeden. <br />Ook is impregnering beter voor de isolatie van de woning.</p>
    <p align="left"><img src="Pictures/TelnrLos.png" width="525" height="49" align="top"/></p>
                             </div>
                       <div class="TabbedPanelsContent" id="Info">
                             test2
                       </div>
                       <div class="TabbedPanelsContent" id="Gallerij">
                             test3
                       </div>
                            <div class="TabbedPanelsContent" id="Contact">
                    <?php echo '<div id="contact_result">'.$form.'</div>'; ?>
                        </div>
                     </div>
           `     </div>
        </div>
         <div id="WFooter" align="center">
             <footer>Wientjes Voegwerk & Renovatie     ,    03- '02         »        Site by ;    <b>Rob Nijlaan</b>        »        Problemen of vragen over deze site?    -    <b><a href="mailto:[email protected]">[email protected]</a></b></footer>
           </div>
    </div>
    </body>
    </html>
    </
    The CSS:
    @charset "utf-8";
    /* CSS Document */
    html,body {
         height:100%; /* needed for container min-height */
         width:100%;
         background: #FFFFFF url(../Pictures/Background.png) no-repeat center;
         color:#000;
    h1{
    font-family: "Trebuchet MS", verdana, arial, helvetica, sans-serif; color: #595999;
    font-weight: bold;
    font-style:italic;
    font-size: 250%;
    h2{
    font-family: "Trebuchet MS", verdana, arial, helvetica, sans-serif; color: #595999;
    font-weight: bold;
    font-size: 200%;
    p{
    font-family: "Trebuchet MS", verdana, arial, helvetica, sans-serif;
    font-size: 110%;
    footer{
    font-family: "Trebuchet MS", verdana, arial, helvetica, sans-serif;
    font-size: 70%;
    #WContainer{
         position:absolute;
         margin:0 auto;
         width:80%;
         background:none;
         height:auto;
         height:100%;
         min-height:100%;
         margin-left: 10%;
         margin-right: 10%;
    #WHeader{
         height: 195px;
         width:100%;
         margin-bottom: 10px;
         margin-left: 0px;
         margin-right: 10px;
    .VTabbedPanels .TabbedPanelsTabGroup {
         float: left;
         width: 172px;
         height: 75px;
         background-color: #FFF;
         position: relative;
         border-top: solid 0px #FFF;
         border-right: solid 0px #FFF;
         border-left: solid 0px #FFF;
         border-bottom: solid 0px #FFF;
    .VTabbedPanels .TabbedPanelsTab {
         float: none;
         margin: 0px;
         border-top: none;
         border-left: none;
         border-right: none;
    .VTabbedPanels .TabbedPanelsContentGroup {
         margin-left: 220px;
         width: auto;
         height: auto;
         min-height:50%;
         max-width:83%;
         min-width:500px;
         padding: 20px 20px 20px 20px;
         border-left: solid 1px #999;
         border-bottom: solid 2px #999;
         border-top: solid 1px #999;
         border-right: solid 2px #999;
    #WFooter{
         clear:both;
         height: 30px;
         margin-top:1px;
    Also i use "SpryTabbedPanels.js", for the html.
    The Contact form: (adjusted to hide critical info from forum users)
    <?php
    require_once('phpmailer/class.phpmailer.php');
    require_once('xajax/xajax_core/xajax.inc.php');
    $form = '<form id="ContactForm">
                <div class="container">
              <label class="contactlabel">Ùw Naam<br /><input name="name" type="text" class="input" /></label>
              <label class="contactlabel">Uw Email Adres:<br /><input name="email" type="text" class="input" /></label>
              <label class="contactlabel">Uw Telefoonnummer:<br /><input name="phone" type="text" class="input" /></label>
              Typ hier uw bericht:<br />
              <textarea name="msg" cols="1" rows="1"></textarea><br />
                 <input type="button" id="subbtn" class="btn" value="Submit" onclick="xajax_myFunction(xajax.getFormValues(\'ContactForm\'));" />
              <div id="form_msg"></div> //this div will contain error messages
            </div>
         </form>';
    function myFunction($get) { 
        global $form, $error;
        $error = '';
        $objResponse = new xajaxResponse();
        $show_form = true; 
        if (!empty($get['email']) && !empty($get['phone']) && !empty($get['msg']) && !empty($get['name'])) {
            if (preg_match("/^[\w-]+(\.[\w-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+([a-z]{2,4})$/i", trim($get['email']))) {
                $email = preg_replace("/\r\n/", "", $get['email']);
                $from = preg_replace("/\r\n/", "", $get['name']);
               $name = $get['name'];
                $phone = $get['phone'];
             $msg = $get['msg'];
             $mail = new PHPMailer();
                $mail->IsSMTP();
                $mail->Host = "mail.YOURHOST.com";
                $mail->SMTPAuth = true;
                $mail->Username = "USERNAME";
                $mail->Password = "PASSWORD";
                $mail->From = $get['email'];
                $mail->FromName = $get['name'];
                $mail->AddAddress("[email protected]");
                $mail->AddReplyTo($email, $from);
                $mail->Subject = "Er is een bericht verzonden vanuit Wientjesvoegwerk.nl";
                $mail->IsHTML(true);
             $mail->Body = "Name: $name <br/> Email: $email <br/> Phone: $phone <br/> Message: $msg";
                if ($mail->Send()) {
                    $error = "Success! Dank u voor uw interesse! Er wordt zo spoedig mogelijk contact met u opgenomen.";
                    $show_form = false;
                } else {
                    $error = "Er is een probleem ontstaan tijdens het verzenden, probeert u het a.u.b. nog eens.";
                        $show_form = true;
            } else {
                $error = "Het ingevoerde email adress is onjuist. Probeert u het a.u.b. nog eens.";
                   $show_form = true;
        } else {
            $error = "Vul a.u.b. alle nodige velden in!";
              $show_form = true;
        if (!$show_form) {
              $objResponse->assign('contact_result', 'innerHTML', $error);
              } else {
              $objResponse->assign('form_msg', 'innerHTML', $error);
        return $objResponse;
    $xajax = new xajax();
    $xajax->registerFunction('myFunction');
    $xajax->processRequest();
    ?>
    Also "class.phpmailer.php" and "xajax.inc.php" are obviously needed as well as some other files from those packages.
    THE BIG PROBLEMS:
    1. Adding the form to a div (into content div of Spry tabbed panels) results in wrong apearance.
         Footer is put to top.
    2. Adding the form to a div results in broken functions.
         Buttons in the Spry tabs dont work anymore.
    3. Java is messed up.
         in top screen you read:  printJavascript('xajax/'); ?>
         in lower screen in content div:  test2 test3 (text from the 2nd and 3rd Content area of Spry, just so its filled with something) and  '.$form.'  '; ?>
    SOLUTIONS ASKED:
    1. Please help me with the contact form so it will work on my page and no error remains. Im not that good in Java...
    2. Please help me solving the problem with the footer. I dont have any clue anymore why this happens. And why no problems occur without the mail form.
    3. Can anyone tell me why the buttons also lose function? It looks like a similar problem as the footer.
    In short: HELP!

    Thank you for pointing me in the right direction. I must honestly say im a hobby programmer that has the capability to learn fast.
    A few weeks ago i only knew html, actionscript, etc. I never worked with xhtml, javascript, css, etc. untill now.
    But with some help i managed to resolve ALL problems so far, exept 2...
    My site has no errors anymore all files are validated 100%!
    The only 2 problems now are;
         1.     The use of <li> for Spry tabs. They make the buttons have a dot in front of them. I hope this can be changed into something that removes the
                 list dots/numbers.
    So from this:
    button
    to this:
    button
         2.     I like to use this email form from: http://www.webbyzone.com/2010/01/10/make-xajax-phpmailer-contact-forms-work/
    The code is embedded in my site but doesnt work at all. Please take a look at it...

  • Inserting a Div in a Div

    Is it possible to insert a div tag (or two) inside another
    div tag. I have
    a background image I want to be in the background of a
    section that will
    have 2 or 3 div tags in it. I know I can go with a table, but
    I am trying
    to get away from them.
    Thanks
    Gary

    You're welcome.
    Walt
    "GPaul" <[email protected]> wrote in message
    news:g8vck1$dqi$[email protected]..
    > Walt
    >
    > Thanks for your answer, I thought a I had done it before
    but it was not
    > working for me.
    >
    > Gary
    > "Walt F. Schaefer" <[email protected]> wrote
    in message
    > news:g8v1s1$sv1$[email protected]..
    >> In its simplest form a div looks like this (in code
    view):
    >> <div></div>
    >>
    >> To insert a div inside that div make it look like
    this:
    >>
    >> <div><div></div></div>
    >>
    >> See?
    >> --
    >>
    >> Walt
    >>
    >>
    >> "GPaul" <[email protected]> wrote in message
    >> news:g8v0qn$rhk$[email protected]..
    >>> Is it possible to insert a div tag (or two)
    inside another div tag. I
    >>> have a background image I want to be in the
    background of a section that
    >>> will have 2 or 3 div tags in it. I know I can go
    with a table, but I am
    >>> trying to get away from them.
    >>>
    >>> Thanks
    >>>
    >>> Gary
    >>>
    >>
    >>
    >
    >

  • No longer able to insert forms without table for layout

    So I just tried for the first time since upgrading to CS6 Dreamweaver to insert a form on a page.
    Previously you were able to insert in DW and it would use DIVS for items. Now however it appears the only option anywhere is to insert form as a table.
    Chat support just confirmed this.
    If true this is a massive step backwards. I'm hoping chat was wrong and I'm just missing something because the extra work involved in removing the tables manually and recoding forms to divs is crazy.
    Please tell me I'm wrong???

    Yeah but I have to manually change it now. Before I could insert in DW as divs.
    We spend enough time wrestling other stuff in to submission - I could do without this now as well.

  • Help with creating basic form in Dreamweaver.

    I am creating a contact for in Dreamweaver CS6.  I have watched many tutorials which say basically the same thing.  I set up form by inserting form into div.
    Then I insert- form-text field.  I fill out the id, label, click the "for" wrap label attribute, click "ok".  I see that "Name:" but do not see the input text box.  What am I missing??
    This is the code:
    <div id="request_for_info">
        <form action="" method="post" name="requestforinformation" id="requestforinformation">
          <table width="100%" border="0" cellpadding="6" cellspacing="0" id="reqinfotable">
            <tr>
              <td width="43%" align="right"><label for="firstname4">First Name:</label>
              <input type="text" name="firstname" id="firstname4"></td>
              <td width="57%" align="left"> </td>
            </tr>

    In it's simplest form (pun intended), copy & paste this HTML5 form code into a new, blank document.  Save As test.html.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 form</title>
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    </head>
    <body>
    <p>Contact Form</p>
    <form id="contact" action="form-processing-script.php" method="post">
    <label for="first_name">Name:</label>
    <br>
    <input name="first_name" id="first_name" type="text" required placeholder="First">
    <label for="last_name"></label>
    <br>
    <input name="last_name" id="last_name" type="text" required placeholder="Last">
    <br>
    <label for="e_mail">E-mail:</label>
    <br>
    <input name="e_mail" id="e_mail" type="email" required placeholder="[email protected]">
    <br>
    <input name="submit" type="submit" value="Submit">
    </form>
    </body>
    </html>
    The other piece of this puzzle is the form-to-email script necessary to gather and process your form data.  Do you have a script yet?  If not, do you know which scripting languages your server supports?
    Nancy O.

  • How can I use a cfwindow with a form in it to update the main page?

    This seems simple enough but I can't figure it out. My main
    page calls a query to get a list of departments. I have put this
    list in a table inside a cfdiv tag. I have an add department link
    on my page. When the user clicks on this link, I want a popup
    window (cfwindow) to display containing a form to add a department.
    Then when the user submits the form, the form should disappear and
    the main page should show the updated list of departments.
    I can't get the form to close without getting an error
    stating that there already is a window with that name and the new
    data doesn't display unless I refresh my screen.
    Here's my departments.cfm page:
    <html>
    <head>
    </head>
    <cfinvoke component="department"
    method="list"
    returnvariable="departments">
    </cfinvoke>
    <body>
    <cfwindow name="deptWindow" title="Department Window"
    draggable="true" resizable="false"
    initshow="false" height="400" width="600" x=200 y=100>
    <cfform action="processDepartment.cfm"
    onsubmit="ColdFusion.Window.hide('deptWindow')">
    Department:
    <cfinput type="text" name="deptname">
    <cfinput type="submit" name="submit">
    </cfform>
    </cfwindow>
    <a href="#"
    onClick="ColdFusion.Window.show('deptWindow')">Add
    Department</a>
    <cfdiv>
    <table>
    <tr>
    <th>Department</th>
    <th>Action</th>
    </tr>
    <cfoutput query="departments">
    <tr>
    <td>#deptname#</td>
    <td><a href="##"
    onClick="ColdFusion.Window.show('deptWindow')">Edit</a></td>
    </tr>
    </cfoutput>
    </table>
    </cfdiv>
    </body>
    </html>
    Here's my department.cfc page:
    <cfcomponent output="false">
    <cfset THIS.dsn="cf8test">
    <cffunction name="list" access="remote" output="false"
    returntype="Query">
    <cfquery name="departments" datasource="#THIS.dsn#">
    SELECT department_id, deptname
    FROM departments
    ORDER by deptname
    </cfquery>
    <cfreturn departments />
    </cffunction>
    <cffunction name="add" access="public" output="false"
    returntype="Boolean">
    <cfargument name="deptname" required="true"
    type="string">
    <cfquery datasource="#THIS.dsn#">
    INSERT INTO departments(deptname)
    VALUES (<cfqueryparam value="#Trim(ARGUMENTS.deptname)#"
    cfsqltype="cf_sql_varchar">)
    </cfquery>
    <cfreturn true />
    </cffunction>
    </cfcomponent>
    And finally, here's my processDepartment.cfm page:
    <!--- Form Field Validation --->
    <cfparam name="FORM.deptname" type="string">
    <cfif IsDefined("FORM.id")>
    <cfset method="update">
    <cfelse>
    <cfset method="add">
    </cfif>
    <cfinvoke component="department"
    method="#method#">
    <cfif IsDefined("FORM.id")>
    <cfinvokeargument name="id"
    value="#FORM.id#">
    </cfif>
    <cfinvokeargument name="deptname"
    value="#Trim(FORM.deptname)#">
    </cfinvoke>
    <!--- When done go back to the Departments listing --->
    <cflocation url="/departments.cfm">

    Hi Jeff,
    One way to do it is to write a JavaScript function that binds
    to your CFC. The CFC should both insert the user values, and then
    select all of the departments from the department table, and then
    return the query set to the page. I wrote sort of a test page which
    gets the state from the States table according to the state
    abbreviation that the user types in from a CFWindow. The table
    never gets updated, however, the result comes back from the CFC
    through AJAX, then updates the main page. You can use this same
    idea but you'll have to update your CFC a little bit. However, the
    idea is the same.
    Here's the code for my get State application. Especially
    notice the following three lines of code in the JavaScript function
    called getStates:
    var d = new getStates2(); //this is the name of your CFC
    d.setForm('form1'); //not sure if you need this, but I found
    it somewhere
    var stateName = d.getAllStates(); //the name of the function
    inside your CFC
    Anyway here's the code in full:
    <style>
    .stateClass {
    font-family: arial;
    font-weight: bold;
    font-size: 12pt;
    padding-top: 10px;
    </style>
    <cfajaxproxy cfc="getStates2">
    <script language="javascript">
    function enter_pressed(e){
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    else return false;
    return (keycode == 13);
    function getStates()
    if(document.form1.theState.value == '') {
    alert('Please make sure the textbox is not empty.');
    return false;
    var d = new getStates2();
    d.setForm('form1');
    var stateName = d.getAllStates();
    ColdFusion.Window.hide('stateWin');
    if (stateName == '')
    document.getElementById('stateDiv').innerHTML = 'No such
    state';
    else
    document.getElementById('stateDiv').innerHTML = 'The state
    is ' + stateName;
    </script>
    <cfwindow name="stateWin" x="100" y="100" width="400"
    height="200">
    <form name="form1" method="post" onsubmit="return
    false;">
    <input name="theState" type="text" size="5"
    onKeyPress="if(enter_pressed(event)){ getStates() }"
    />
    <input type="button" value="get state"
    onClick="getStates()">
    </form>
    </cfwindow>
    <div id="stateDiv" class="stateClass">
    </div>
    <a
    href="javascript:ColdFusion.Window.show('stateWin')">find a
    state</a>

  • Email a form using PHP works intermittently

    Hello all,
    I'm using DW CS6/ Win 7. I have created a simple subscription form where the user enters their email and the form is emailed to an administrator. Sometimes it works and sometimes it doesn't and I have no idea why. Occasionally I  receive the email after a delay of several minutes and sometimes it never arrives. The webpage is here www.sanbenitoolivefestival.com/contactus2.php , below is the script , I've tried in IE and FF, same intermittent results. I'm new to FF/ Firebug but it didn't report any errors that I could see
    <div class="subscribe">
        <div class="spacer"></div>
    <?php
    if ((isset($_REQUEST['email'])) && ($_REQUEST['email'] != " Enter Email Address"))
    //if "email" is filled out, send email
        echo "sending mail";
        //send email
       $email = $_REQUEST["email"] ;
       $subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
       $message = "Please add my email address to the SBOF email subscription list" ;
       mail("[email address removed by moderator]", $subject,
       $message, "From:" . $email);
       echo "Thank you, we have sent your subscription request";
    else
    //if "email" is not filled out, display the form
       echo '<form action="contactus2.php" method="post" >
         <em>Stay in touch by joining our email list.                  
          <input name="email" type="text" value=" Enter Email Address" size="42"  class="input" />         
         <input name="submit" type="submit" value="   SUBSCRIBE  " class="button"/>
          </em>
        </form>';
    ?>
    </div>

    You are using an extremely insecure technique that lays your form wide open to a malicious attack known as email header injection, which can turn your form into a spam relay.
    You should NEVER use unfiltered form input in the email headers. The From header is intended to indicate who sent the email. In this case, it's your website, not the person who fills out the form. If you want the convenience of hitting the reply button in your email program to use the sender's email address, you should use the Reply-to header instead of From.
    Misusing the From header like this is one possible cause of your emails not getting through. You should also check with your hosting company to see if they require the fifth argument to mail() to be set. This is normally a string that begins with -f followed immediately by a known email address on the same domain as the server, for example '[email protected]'.
    Also, using $_REQUEST is insecure.
    Change your code like this:
    <?php
    if ((isset($_POST['email'])) && ($_POST['email'] != " Enter Email Address"))
    //if "email" is filled out, send email
        // make sure the email is OK
        $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
        // send the message only if the email address is valid
        if ($email) {
            echo "sending mail";
            //send email
            $from = '[email protected]';  // this should be your own email address
            $subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
            $message = "Please add my email address to the SBOF email subscription list" ;
            $headers = "From: $from\r\nReply-to: $email";
            $sent = mail("[email address removed by moderator]", $subject,
                $message, $headers);
            if ($sent) {
                echo "Thank you, we have sent your subscription request";
           } else {
                echo 'Sorry, there was a problem sending your request';
    else
    //if "email" is not filled out, display the form
       echo '<form action="contactus2.php" method="post" >
         <em>Stay in touch by joining our email list.                 
          <input name="email" type="text" value=" Enter Email Address" size="42"  class="input" />        
         <input name="submit" type="submit" value="   SUBSCRIBE  " class="button"/>
          </em>
        </form>';
    ?>

  • Email form not coming through to inbox

    Hello everyone.
    I've built a email form in DW CS3 (It's a custom form, not something I got from godaddy or from internet), but when you type in the info, from the form it is not coming to the inbox once you hit send. Can anyone tell me what I'm doing wrong?
    I'm using godaddy. In "action" I have: /gdform.php (Post).
    Here is the code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Process/Mosotomoss/Image Stager</title>
    <style type="text/css">
    <!--
    #apDiv1 {
              position:absolute;
              left:195px;
              top:17px;
              width:692px;
              height:1682px;
              z-index:1;
    .style1 {color: #FFFFFF
    #apDiv3 {
              position:absolute;
              left:193px;
              top:1700px;
              width:1020px;
              height:24px;
              z-index:2;
    #apDiv2 {
              position:absolute;
              left:301px;
              top:743px;
              width:397px;
              height:40px;
              z-index:3;
    #apDiv4 {
              position:absolute;
              left:298px;
              top:739px;
              width:603px;
              height:36px;
              z-index:3;
              background-color: #FFFFFF;
    #apDiv5 {
              position:absolute;
              left:300px;
              top:741px;
              width:509px;
              height:31px;
              z-index:3;
              background-color: #FFFFFF;
    #apDiv6 {
              position:absolute;
              left:299px;
              top:739px;
              width:353px;
              height:38px;
              z-index:3;
    #apDiv7 {
              position:absolute;
              left:305px;
              top:741px;
              width:382px;
              height:40px;
              z-index:3;
    #apDiv8 {
              position:absolute;
              left:301px;
              top:738px;
              width:822px;
              height:530px;
              z-index:3;
    #apDiv9 {
              position:absolute;
              left:299px;
              top:742px;
              width:824px;
              height:528px;
              z-index:3;
    #apDiv10 {
              position:absolute;
              left:443px;
              top:745px;
              width:401px;
              height:258px;
              z-index:4;
    #apDiv11 {
              position:absolute;
              left:300px;
              top:746px;
              width:143px;
              height:257px;
              z-index:5;
    #apDiv12 {
              position:absolute;
              left:1227px;
              top:586px;
              width:240px;
              height:272px;
              z-index:4;
    -->
    </style>
    <script type="text/javascript">
    <!--
    function MM_validateForm() { //v4.0
      if (document.getElementById){
        var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
        for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
          if (val) { nm=val.name; if ((val=val.value)!="") {
            if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
              if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
            } else if (test!='R') { num = parseFloat(val);
              if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
              if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
                min=test.substring(8,p); max=test.substring(p+1);
                if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
          } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
        } if (errors) alert('The following error(s) occurred:\n'+errors);
        document.MM_returnValue = (errors == '');
    //-->
    </script>
    </head>
    <body>
    <div id="apDiv1">
      <div align="center"><img src="images/process.jpg" width="1024" height="1685" border="0" usemap="#Map" />
          <map name="Map" id="Map">
            <area shape="rect" coords="791,45,832,73" href="blog.html" />
            <area shape="rect" coords="841,29,882,74" href="http://www.youtube.com/user/mosotomoss" />
            <area shape="rect" coords="730,44,781,68" href="store.html" />
            <area shape="rect" coords="885,30,929,76" href="https://www.facebook.com/pages/Mosotomoss/125744364118146" />
            <area shape="rect" coords="929,28,974,75" href="http://twitter.com/mosotomoss" />
            <area shape="rect" coords="670,45,722,69" href="press.html" />
            <area shape="rect" coords="611,45,660,69" href="faq.html" />
            <area shape="rect" coords="223,43,298,72" href="process.html" />
            <area shape="rect" coords="304,42,384,68" href="services.html" />
            <area shape="rect" coords="136,40,220,68" href="about.html" />
            <area shape="rect" coords="394,42,505,70" href="1on1staging.html" />
            <area shape="rect" coords="518,45,602,72" href="team.html" />
            <area shape="rect" coords="56,24,117,83" href="index.html" />
            </map>
      </div>
    </div>
    <div class="style1" id="apDiv3">Mosotomoss is an Image Staging Company and an Image Making Company</div>
    <div id="apDiv9">
      <form id="form1" name="form1" method="post" action="/gdform.php">
        <table width="100%" border="0" cellpadding="6">
          <tr>
            <td><div align="right">
              <label>First Name:</label>
            </div></td>
            <td><div align="left">
              <input name="firstname" type="text" id="firstname" size="35" maxlength="90" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>Last Name:</label>
            </div></td>
            <td><div align="left">
              <input name="lastname" type="text" id="lastname" size="35" maxlength="90" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>Company:</label>
            </div></td>
            <td><div align="left">
              <input name="company" type="text" id="company" size="35" maxlength="90" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>Website:</label>
            </div></td>
            <td><div align="left">
              <input name="website" type="text" id="website" size="35" maxlength="90" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">Email:</div></td>
            <td><div align="left">
              <input name="email" type="text" id="email" size="35" maxlength="90" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>Phone:</label>
            </div></td>
            <td><div align="left">
              <input name="phone" type="text" id="phone" size="35" maxlength="15" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>City:</label>
            </div></td>
            <td><div align="left">
              <input name="city" type="text" id="city" size="35" maxlength="90" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>State:</label>
            </div></td>
            <td><div align="left">
              <input name="state" type="text" id="state" size="35" maxlength="90" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">Services:</div></td>
            <td><div align="left">
              <p>
                <label>
                  <input type="radio" name="Services" value="Seminars" id="Services_0" />
                  Seminars</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Mentoring" id="Services_1" />
                  Mentoring</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Workshops" id="Services_2" />
                  Workshops</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="1on1 Staging" id="Services_3" />
                  1on1 Staging</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Marketing & PR" id="Services_4" />
                  Marketing & PR</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Nonprofit Staging" id="Services_5" />
                  Nonprofit Staging</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Business Planning" id="Services_6" />
                  Business Planning</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Customer relations" id="Services_7" />
                  Customer relations</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Business Plan Staging" id="Services_8" />
                  Business Plan Staging</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Social Media & Networking" id="Services_9" />
                  Social Media & Networking</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="Everyday Retail Store Staging" id="Services_10" />
                  Everyday Retail Store Staging</label>
                <br />
                <label>
                  <input type="radio" name="Services" value="radio" id="Services_11" />
                  Consistent & Cohesive Staging</label>
                <br />
              </p>
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>How can we help you?</label>
            </div></td>
            <td><div align="left">
              <textarea name="howcanwehelpyou" id="howcanwehelpyou" cols="25" rows="5"></textarea>
            </div></td>
          </tr>
          <tr>
            <td><div align="right"></div></td>
            <td><div align="left">
              <label>
              <input name="newsletter" type="checkbox" id="newsletter" value="subscribe me" checked="checked" />
              Would you like to subscribe to our FREE newsletter?</label>
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
              <label>
              <input type="reset" name="clear" id="clear" value="Reset Form" />
              </label>
            </div></td>
            <td><div align="left">
              <label>
              <input name="submit" type="submit" id="submit" onclick="MM_validateForm('firstname','','R','lastname','','R','email','','RisEmail','phon e','','R');return document.MM_returnValue" value="Submit form" />
              </label>
            </div></td>
          </tr>
          <tr>
            <td><div align="right"></div></td>
            <td><div align="left"></div></td>
          </tr>
        </table>
        <input name="reciepient" type="hidden" id="reciepient" value="[email protected]" />
        <input name="Redirect" type="hidden" id="Redirect" value="emailform.html" />
      </form>
    </div>
    <div align="center"></div>
    </body>
    </html>

    You have this:
      <input name="reciepient" type="hidden" id="reciepient" value="[email protected]" />
    which should be
      <input name="recipient" type="hidden" id="recipient" value="[email protected]" />
    ...but I don't know if current gdform.php processor uses the recipient field, or some other mechanism. Try fixing the typo and if it still doesn't work you need to contact GD for support.

  • Can't Click Inside Form

    Hi again! I am having an issue with something I'm experimenting with. I'm looking to add a Form and Button to my site, but when adding it inside of a specific div, I can't click inside the Form field.
    Test Site Below:
    Rental Management Company
    The highlighted area is the part I'm talking about. My theory is that I can't click inside that field because it's connected to the slider pro javascript, and anything inside the div is treated like an image or sorts. Is there any way I can get around this? Any and all help is appreciated, thanks in advance!

    HTML:
    <h1 align="center">+$1000</h1>
        <div id="example1" class="sliderpro">
            <div class="ad">
                <div class="sp-slides">
                    <div class="sp-slide">
                        <img src="Rental Pics/Lenoir509 thumb.jpg" alt="Lenoir" width="300" height="131">
                            <br />
                        <b><span style="font-family: Arial"><font size="2">Lenoir 509 --- $1200.00 --- 7 rooms, 3 Bedrooms, 2 Bath --- Lease Term: 1 Year --- Date Available: 05/23/2012</font></span></b><br />
                        <b><span style="font-family: Arial"><font size="2">Security Deposit: Based on Credit Approval --- Pets: Management Option --- Approx. square feet: 2200</font></span></b><br />
                        <b><span style="font-family: Arial"><font size="2">Property Address: 509 Lenoir Drive, Spring Lake NC, Overhills Creek</font></span></b>,
                        <b><span style="font-family: Arial"><font size="2">Harnett County</font></span></b><br />
                        <b><span style="font-family: Arial"><font size="2">Living Room, Dining Room, Fireplace, Bonus Room</font></span></b><br />
                        <b><span style="font-family: Arial"><font size="2">Dishwasher, Range, Refrigerator, Washer Connection, Dryer Connection, Patio, Double Garage</font></span></b><br />
                        <b><span style="font-family: Arial"><font size="2">Overhills Elementary School, Overhills Middle School, Overhills High School</font></span></b><br />
                        <b><span style="font-family: Arial"><font size="2">Type of Heat: Heat Pump --- Air Conditioning: Heat Pump --- Floors: Carpet, Hardwood, Vinyl --- Draperies: Mini Blinds - Water Company: Harnett --- Gas Company: N/A - Electrical Company: South River --- Oil Company: N/A</font></span></b><br />
    <form action="http://maps.google.com/maps" method="get" target="_blank">
    <b><span style="font-family: Arial"><font size="2">Enter your starting address:</font></span></b><input type="text" name="saddr" /><input type="hidden" name="daddr" value="509 Lenoir Drive, Spring Lake NC" /><input type="submit" value="Get Directions" />
    </form><br />
                    </div>
                </div>
            </div>
         </div>
    CSS:
    .slider-pro{position:relative;margin:0 auto;width:100%}.sp-slides-container{position:relative; height:250px; width:100%;}.sp-mask{position:relative;overflow:hidden}.sp-slides{position:relative;-webk it-backface-visibility:hidden;-webkit-perspective:1000}.sp-slide{position:absolute}.sp-ima ge-container{overflow:hidden}.sp-image{position:relative;display:block;border:none}.sp-no- js{overflow:hidden;max-width:75px}.sp-thumbnails-container{position:relative;overflow:hidd en}.sp-bottom-thumbnails,.sp-top-thumbnails{left:0;margin:0 auto}.sp-top-thumbnails{position:absolute;top:0;margin-bottom:4px}.sp-bottom-thumbnails{m argin-top:4px}.sp-left-thumbnails,.sp-right-thumbnails{position:absolute;top:0}.sp-right-t humbnails{right:0;margin-left:4px}.sp-left-thumbnails{left:0;margin-right:4px}.sp-thumbnai ls{position:relative}.sp-thumbnail{border:none}.sp-thumbnail-container{position:relative;d isplay:block;overflow:hidden;float:left;-moz-box-sizing:border-box;box-sizing:border-box}. sp-bottom-thumbnails .sp-thumbnail-container,.sp-top-thumbnails .sp-thumbnail-container{margin-left:2px;margin-right:2px}.sp-bottom-thumbnails .sp-thumbnail-container:first-child,.sp-top-thumbnails .sp-thumbnail-container:first-child{margin-left:0}.sp-bottom-thumbnails .sp-thumbnail-container:last-child,.sp-top-thumbnails .sp-thumbnail-container:last-child{margin-right:0}.sp-left-thumbnails .sp-thumbnail-container,.sp-right-thumbnails .sp-thumbnail-container{margin-top:2px;margin-bottom:2px}.sp-left-thumbnails .sp-thumbnail-container:first-child,.sp-right-thumbnails .sp-thumbnail-container:first-child{margin-top:0}.sp-left-thumbnails .sp-thumbnail-container:last-child,.sp-right-thumbnails .sp-thumbnail-container:last-child{margin-bottom:0}.sp-right-thumbnails.sp-has-pointer{ma rgin-left:-13px}.sp-right-thumbnails.sp-has-pointer .sp-thumbnail{position:absolute;left:18px;margin-left:0!important}.sp-right-thumbnails.sp -has-pointer .sp-selected-thumbnail:before{content:'';position:absolute;height:100%;border-left:5px solid red;left:0;top:0;margin-left:13px}.sp-right-thumbnails.sp-has-pointer .sp-selected-thumbnail:after{content:'';position:absolute;width:0;height:0;left:0;top:50% ;margin-top:-8px;border-right:13px solid red;border-top:8px solid transparent;border-bottom:8px solid transparent}.sp-left-thumbnails.sp-has-pointer{margin-right:-13px}.sp-left-thumbnails.sp- has-pointer .sp-thumbnail{position:absolute;right:18px}.sp-left-thumbnails.sp-has-pointer .sp-selected-thumbnail:before{content:'';position:absolute;height:100%;border-left:5px solid red;right:0;top:0;margin-right:13px}.sp-left-thumbnails.sp-has-pointer .sp-selected-thumbnail:after{content:'';position:absolute;width:0;height:0;right:0;top:50 %;margin-top:-8px;border-left:13px solid red;border-top:8px solid transparent;border-bottom:8px solid transparent}.sp-bottom-thumbnails.sp-has-pointer{margin-top:-13px}.sp-bottom-thumbnails.s p-has-pointer .sp-thumbnail{position:absolute;top:18px;margin-top:0!important}.sp-bottom-thumbnails.sp- has-pointer .sp-selected-thumbnail:before{content:'';position:absolute;width:75px;border-bottom:5px solid red;top:0;margin-top:13px}.sp-bottom-thumbnails.sp-has-pointer .sp-selected-thumbnail:after{content:'';position:absolute;width:0;height:0;left:50%;top:0 ;margin-left:-8px;border-bottom:13px solid red;border-left:8px solid transparent;border-right:8px solid transparent}.sp-top-thumbnails.sp-has-pointer{margin-bottom:-13px}.sp-top-thumbnails.sp-h as-pointer .sp-thumbnail{position:absolute;bottom:18px}.sp-top-thumbnails.sp-has-pointer .sp-selected-thumbnail:before{content:'';position:absolute;width:150;border-bottom:5px solid red;bottom:0;margin-bottom:13px}.sp-top-thumbnails.sp-has-pointer .sp-selected-thumbnail:after{content:'';position:absolute;width:0;height:0;left:50%;botto m:0;margin-left:-8px;border-top:13px solid red;border-left:8px solid transparent;border-right:8px solid transparent}.sp-layer{position:absolute;margin:0;box-sizing:border-box;-moz-box-sizing:bo rder-box;-webkit-box-sizing:border-box;-webkit-font-smoothing:subpixel-antialiased;-webkit -backface-visibility:hidden}.sp-black{color:#FFF;background:#000;background:rgba(0,0,0,.7) }.sp-white{color:#000;background:#fff;background:rgba(255,255,255,.7)}.sp-rounded{border-r adius:10px}.sp-padding{padding:10px}.sp-grab{cursor:url(images/openhand.cur),move}.sp-grab bing{cursor:url(images/closedhand.cur),move}.sp-selectable{cursor:default}.sp-caption-cont ainer{text-align:center;margin-top:10px}.sp-full-screen{margin:0!important;background-colo r:#000}.sp-full-screen-button{position:absolute;top:5px;right:10px;font-size:30px;line-hei ght:1;cursor:pointer;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform :rotate(45deg)}.sp-full-screen-button:before{content:'\2195'}.sp-fade-full-screen{opacity: 0;-webkit-transition:opacity .5s;transition:opacity .5s}.slider-pro:hover .sp-fade-full-screen{opacity:1}@media only screen and (min-width:768px) and (max-width:1024px){}@media only screen and (min-width:568px) and (max-width:768px)}@media only screen and (min-width:320px) and (max-width:568px)}.sp-arrows{position:absolute}.sp-fade-arrows{opacity:0;-webkit-transiti on:opacity .5s;transition:opacity .5s}.sp-slides-container:hover .sp-fade-arrows{opacity:1} .sp-arrows{width:75px;left:0;top:50%;margin-top:-15px}.sp-vertical .sp-arrows{height:100%;left:50%;top:0;margin-left:-10px}.sp-arrow{position:absolute;displ ay:block;width:20px;height:30px;cursor:pointer}.sp-vertical .sp-arrow{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90 deg)}.sp-horizontal .sp-previous-arrow{left:20px}.sp-horizontal .sp-next-arrow{right:20px}.sp-vertical .sp-previous-arrow{top:20px}.sp-vertical .sp-next-arrow{bottom:20px}.sp-next-arrow:after,.sp-next-arrow:before,.sp-previous-arrow: after,.sp-previous-arrow:before{content:'';position:absolute;width:50%;height:50%;backgrou nd-color:#FFF}.sp-previous-arrow:before{left:30%;top:0;-webkit-transform:skew(145deg,0deg) ;-ms-transform:skew(145deg,0deg);transform:skew(145deg,0deg)}.sp-previous-arrow:after{left :30%;top:50%;-webkit-transform:skew(-145deg,0deg);-ms-transform:skew(-145deg,0deg);transfo rm:skew(-145deg,0deg)}.sp-next-arrow:before{right:30%;top:0;-webkit-transform:skew(35deg,0 deg);-ms-transform:skew(35deg,0deg);transform:skew(35deg,0deg)}.sp-next-arrow:after{right: 30%;top:50%;-webkit-transform:skew(-35deg,0deg);-ms-transform:skew(-35deg,0deg);transform: skew(-35deg,0deg)}.ie7 .sp-arrow,.ie8 .sp-arrow{width:0;height:0}.ie7 .sp-arrow:after,.ie7 .sp-arrow:before,.ie8 .sp-arrow:after,.ie8 .sp-arrow:before{content:none}.ie7.sp-horizontal .sp-previous-arrow,.ie8.sp-horizontal .sp-previous-arrow{border-right:20px solid #FFF;border-top:20px solid transparent;border-bottom:20px solid transparent}.ie7.sp-horizontal .sp-next-arrow,.ie8.sp-horizontal .sp-next-arrow{border-left:20px solid #FFF;border-top:20px solid transparent;border-bottom:20px solid transparent}.ie7.sp-vertical .sp-previous-arrow,.ie8.sp-vertical .sp-previous-arrow{border-bottom:20px solid #FFF;border-left:20px solid transparent;border-right:20px solid transparent}.ie7.sp-vertical .sp-next-arrow,.ie8.sp-vertical .sp-next-arrow{border-top:20px solid #FFF;border-left:20px solid transparent;border-right:20px solid transparent}.sp-thumbnail-arrows{position:absolute}.sp-fade-thumbnail-arrows{opacity:0;-w ebkit-transition:opacity .5s;transition:opacity .5s}.sp-thumbnails-container:hover .sp-fade-thumbnail-arrows{opacity:1}.sp-bottom-thumbnails .sp-thumbnail-arrows,.sp-top-thumbnails .sp-thumbnail-arrows{width:75px;top:50%;left:0;margin-top:-12px}.sp-left-thumbnails .sp-thumbnail-arrows,.sp-right-thumbnails .sp-thumbnail-arrows{height:100%;top:0;left:50%;margin-left:-7px}.sp-thumbnail-arrow{posi tion:absolute;display:block;width:15px;height:25px;cursor:pointer}.sp-left-thumbnails .sp-thumbnail-arrows .sp-thumbnail-arrow,.sp-right-thumbnails .sp-thumbnail-arrows .sp-thumbnail-arrow{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform :rotate(90deg)}.sp-bottom-thumbnails .sp-previous-thumbnail-arrow,.sp-top-thumbnails .sp-previous-thumbnail-arrow{left:0}.sp-bottom-thumbnails .sp-next-thumbnail-arrow,.sp-top-thumbnails .sp-next-thumbnail-arrow{right:0}.sp-left-thumbnails .sp-previous-thumbnail-arrow,.sp-right-thumbnails .sp-previous-thumbnail-arrow{top:0}.sp-left-thumbnails .sp-next-thumbnail-arrow,.sp-right-thumbnails .sp-next-thumbnail-arrow{bottom:0}.sp-next-thumbnail-arrow:after,.sp-next-thumbnail-arrow :before,.sp-previous-thumbnail-arrow:after,.sp-previous-thumbnail-arrow:before{content:''; position:absolute;width:75px;height:50%;background-color:#FFF}.sp-previous-thumbnail-arrow :before{left:30%;top:0;-webkit-transform:skew(145deg,0deg);-ms-transform:skew(145deg,0deg) ;transform:skew(145deg,0deg)}.sp-previous-thumbnail-arrow:after{left:30%;top:50%;-webkit-t ransform:skew(-145deg,0deg);-ms-transform:skew(-145deg,0deg);transform:skew(-145deg,0deg)} .sp-next-thumbnail-arrow:before{right:30%;top:0;-webkit-transform:skew(35deg,0deg);-ms-tra nsform:skew(35deg,0deg);transform:skew(35deg,0deg)}.sp-next-thumbnail-arrow:after{right:30 %;top:50%;-webkit-transform:skew(-35deg,0deg);-ms-transform:skew(-35deg,0deg);transform:sk ew(-35deg,0deg)}.ie7 .sp-thumbnail-arrow,.ie8 .sp-thumbnail-arrow{width:0;height:0}.ie7 .sp-thumbnail-arrow:after,.ie7 .sp-thumbnail-arrow:before,.ie8 .sp-thumbnail-arrow:after,.ie8 .sp-thumbnail-arrow:before{content:none}.ie7 .sp-bottom-thumbnails .sp-previous-thumbnail-arrow,.ie7 .sp-top-thumbnails .sp-previous-thumbnail-arrow,.ie8 .sp-bottom-thumbnails .sp-previous-thumbnail-arrow,.ie8 .sp-top-thumbnails .sp-previous-thumbnail-arrow{border-right:12px solid #FFF;border-top:12px solid transparent;border-bottom:12px solid transparent}.ie7 .sp-bottom-thumbnails .sp-next-thumbnail-arrow,.ie7 .sp-top-thumbnails .sp-next-thumbnail-arrow,.ie8 .sp-bottom-thumbnails .sp-next-thumbnail-arrow,.ie8 .sp-top-thumbnails .sp-next-thumbnail-arrow{border-left:12px solid #FFF;border-top:12px solid transparent;border-bottom:12px solid transparent}.ie7 .sp-left-thumbnails .sp-previous-thumbnail-arrow,.ie7 .sp-right-thumbnails .sp-previous-thumbnail-arrow,.ie8 .sp-left-thumbnails .sp-previous-thumbnail-arrow,.ie8 .sp-right-thumbnails .sp-previous-thumbnail-arrow{border-bottom:12px solid #FFF;border-left:12px solid transparent;border-right:12px solid transparent}.ie7 .sp-left-thumbnails .sp-next-thumbnail-arrow,.ie7 .sp-right-thumbnails .sp-next-thumbnail-arrow,.ie8 .sp-left-thumbnails .sp-next-thumbnail-arrow,.ie8 .sp-right-thumbnails .sp-next-thumbnail-arrow{border-top:12px solid #FFF;border-left:12px solid transparent;border-right:12px solid transparent}a.sp-video{text-decoration:none}a.sp-video img{-webkit-backface-visibility:hidden;border:none}a.sp-video:after{content:'\25B6';posit ion:absolute;width:45px;padding-left:5px;height:50px;border:2px solid #FFF;text-align:center;font-size:30px;border-radius:30px;top:0;color:#FFF;bottom:0;left:0 ;right:0;background-color:rgba(0,0,0,.2);margin:auto;line-height:52px}.slider-pro img.sp-image,.slider-pro img.sp-thumbnail{max-width:none!important;max-height:none!important;border:none!important ;border-radius:0!important;padding:0!important;-webkit-box-shadow:none!important;-mox-box- shadow:none!important;box-shadow:none!important;transition:none;-moz-transition:none;-webk it-transition:none;-o-transition:none}.slider-pro a{position:static;transition:none!important;-moz-transition:none!important;-webkit-transi tion:none!important;-o-transition:none!important}.slider-pro canvas,.slider-pro embed,.slider-pro iframe,.slider-pro object,.slider-pro video{max-width:none;max-height:none}.slider-pro p.sp-layer{font-size:14px;line-height:1.4;margin:0}.slider-pro h1.sp-layer{font-size:32px;line-height:1.4;margin:0}.slider-pro h2.sp-layer{font-size:24px;line-height:1.4;margin:0}.slider-pro h3.sp-layer{font-size:19px;line-height:1.4;margin:0}.slider-pro h4.sp-layer{font-size:16px;line-height:1.4;margin:0}.slider-pro h5.sp-layer{font-size:13px;line-height:1.4;margin:0}.slider-pro h6.sp-layer{font-size:11px;line-height:1.4;margin:0}.slider-pro img.sp-layer{border:none}

  • Displaying a form in a set of accordian panels

    The Spry Accordion Panel looks as though it aught to be ideal
    for inserting a large data records into an on line database.
    However, this use does not seem to be documented as far as I can
    see. I wanted
    to split up the data into sections within the same form to
    provide headings for each section, and thus take up less space on
    the page, removing the need to have multi page forms. Is this
    possible?

    Hi,
    Do you mean something like this?
    <form action="">
    <div id="Acc1" class="Accordion">
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Step 1: Enter Your
    Personal Information</div>
    <div class="AccordionPanelContent">
    <table>
    <tr>
    <th>First Name:</th>
    <td><input type="text" name="firstname"
    /></td>
    </tr>
    <tr>
    <th>Middle Initial:</th>
    <td><input type="text" name="middleinitial"
    /></td>
    </tr>
    <tr>
    <th>Last Name:</th>
    <td><input type="text" name="lastname"
    /></td>
    </tr>
    </table>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Step 2: Tell Us About
    Yourself</div>
    <div class="AccordionPanelContent">
    <table>
    <tr>
    <th>Hobbies:</th>
    <td><textarea
    name="hobbies"></textarea></td>
    </tr>
    <tr>
    <th>Interests:</th>
    <td><textarea
    name="interests"></textarea></td>
    </tr>
    <tr>
    <th>Volunteer:</th>
    <td><textarea
    name="volunteer"></textarea></td>
    </tr>
    </table>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Step 3:
    Submit</div>
    <div class="AccordionPanelContent">
    <p>
    <input type="submit" />
    </p>
    </div>
    </div>
    </div>
    </form>
    <script type="text/javascript">
    var acc1 = new Spry.Widget.Accordion("Acc1");
    </script>
    --== Kin ==--

  • Forms IVS - Order of form designs

    Hi there,
    We have around 200 forms being tested in Forms IVS.  The forms are named sequentially with numbers F001, F002, F003, and so on.  The problem we have is the forms are not listed in IVS in any order.  Not too much of an issue when you have 5 forms, but having 200 is proving a royal pain for our testers trying to locate forms in the list.
    There is no way of ordering the forms in the list.  I have checked the modified time of the file, the size, the name, when it was addded to the forms folder - none of this has any effect on how the forms are listed.  They just list in a random order.
    This is proving a headache for our testers and wasting a lot of our time.  We cannot reduce the number of forms in IVS and we need to test them in a specific order.
    Can anyone please asdvise on what basis/criteria the form designs are listed in Forms IVS.
    Thanks in advance.
    Paul.
    RHEL 4.7
    JBoss 4.2.0
    LiveCycle ES 8.2 Update 1

    unable to attach source file.....  here is the source....you may need to tweak or modify slightly to get it to work again.
    jim
    =======================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page language="java" contentType="text/html; charset=UTF-8" import="java.io.*,com.adobe.formServer.webSamples.*,com.adobe.formServer.webSamples.App.A ppFactory,java.util.*" %>
    <%
        boolean bShowPlatform = false;
        String sShowPlatform = (String) application.getAttribute("showPlatform");
        bShowPlatform = new Boolean(sShowPlatform).booleanValue();
        boolean bExpertMode = false;
        String sExpertMode = (String) application.getAttribute("expertMode");
        bExpertMode = new Boolean(sExpertMode).booleanValue();
        ServletContext oContext = getServletConfig().getServletContext();
        App oApp = AppFactory.create(null, oContext, request, response);
        String[] formFiles = new String[0];
        String[] dataFiles = new String[0];
        LinkedHashMap prefMap = null;
        try {
            formFiles = oApp.listFiles (oApp.m_sContentRootURI);
            dataFiles = oApp.listFiles (oApp.m_sDataDirectory);
            prefMap = oApp.listPreferences();
      } catch (Exception oException ) {
        throw new ServletException( oException.getMessage() );
        // create a filename filter object to only return xdp templates   
        FilenameFilter filter = new FilenameFilter() {
            public boolean accept(File dir,String name){return name.endsWith(".xdp");}           
        // retrieve the templates directory   
        File dir = new File(oApp.m_sContentRootURI);
        // retrieve all the file in the templates dir
        File[] files = dir.listFiles(filter);
        // quick check to see if there are any xdp templates in content root directory that was specified    in preferences
        if (dir.exists() && (files.length > 0)) {
                // do nothing if everything ok
        } else {
                out.println("<h2 style='color:red; font-size:20px'> UNABLE TO LOCATE ANY XDP TEMPLATES IN CONTENT ROOT DIRECTORY.<br> PLEASE RECHECK <i style='color:blue;'>CONTENT ROOT URI</i> SETTING IN PREFERENCES</h2>");
    %>
    <html>
    <head>
    <title>Installation Verification Sample - Test form designs</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <style type="text/css">
      @import url("ivs.css");
      @import url("cont.css" );
      @import url("icons.css");
    </style>
    <script type="text/javascript">
        App = new Object();
        App.CLIENT_EJB = <%=App.CLIENT_EJB%>;
        App.CLIENT_EJB_LOCAL = <%=App.CLIENT_EJB_LOCAL%>;
        App.CLIENT_SOAP = <%=App.CLIENT_SOAP%>;
        App.CLIENT_PLATFORM = <%=App.CLIENT_PLATFORM%>;
        App.CLIENT_PLATFORM_SOAP = <%=App.CLIENT_PLATFORM_SOAP%>;
        function getForm(action, clientType) {        
            if (document.formGet.formName.selectedIndex >= 0 ) {
                document.formGet.GenerateCSS.value = "0";
                document.formGet.clientType.value = clientType;
                  document.formGet.actionType.value = "";
                document.formGet.action = action;
                document.formGet.submit();
            } else {
                alert("Select a form design to render");
        function issueCSSGeneration(action) {
            if (document.formGet.formName.selectedIndex >= 0 ) {
                    if(document.formGet.runPerf.checked == true){
                        alert("Performance check is not enabled while CSS generation");
                    document.formGet.GenerateCSS.value = "1";
                    document.formGet.clientType.value = <%=App.CLIENT_EJB%>;
                    document.formGet.actionType.value = "";
                    document.formGet.action = action;
                    document.formGet.submit();
            } else {
                    alert("Select a form to generate CSS");
        function setCSSGenButtonVisibility(){
            var elem = document.getElementById('CSSGenButton');
            var outputType = document.formGet.preference.options[document.formGet.preference.selectedIndex].value;
            if(!(document.formGet.formName.selectedIndex >= 0)){
                elem.style.display = 'none';
            } else {
            if(outputType == 'AUTO' || outputType == 'XHTML' || outputType == 'MSDHTML' || outputType == 'HTML4'
                || outputType == 'AHTML' || outputType == 'StaticHTML' || outputType == 'NoScriptXHTML')
                elem.style.display = 'block';
            } else {
                elem.style.display = 'none';
        function generatePrefs() {
            var prefs = new OptionMap();
            <%
            Object[] prefSet = prefMap.entrySet().toArray();
            for (int i=0; i < prefSet.length; i++) {
                Map.Entry e = (Map.Entry) prefSet[i];
                %>
                prefs.add("<%=e.getKey()%>", "<%=e.getValue()%>");
                <%
            %>
            if (document.formGet.formName.selectedIndex >= 0 ) {           
                var sFormName = document.formGet.formName.options[document.formGet.formName.selectedIndex].value;            
                if (sFormName.indexOf(".xdp") >= 0) {
                    // remove PDFMerge and nativePDF
                    prefs.remove("PDFMerge");
                    prefs.remove("NativePDF");
                if (sFormName.indexOf(".pdf") >= 0) {
                    // remove HTML transformations
                    prefs.remove("AUTO");
                    prefs.remove("MSDHTML");
                    prefs.remove("XHTML");
                    prefs.remove("HTML4");
                    prefs.remove("AHTML");
                    prefs.remove("StaticHTML");
                    prefs.remove("NoScriptXHTML");
                    // remove LayoutXML
                    prefs.remove("Layout");
                if (sFormName.indexOf(".swf") >= 0) {
                    prefs.remove("PDFMerge");
                    prefs.remove("NativePDF");
                    prefs.remove("AUTO");
                    prefs.remove("MSDHTML");
                    prefs.remove("XHTML");
                    prefs.remove("HTML4");
                    prefs.remove("AHTML");
                    prefs.remove("StaticHTML");
                    prefs.remove("NoScriptXHTML");
                    prefs.remove("Layout");
            <%if (!bExpertMode) { %>
                //remove NativePDF
                prefs.remove("NativePDF");
                //remove LayoutXML
                prefs.remove("Layout");
            <%}%>
            document.formGet.preference.length = 0;
            for (var i = 0; i < prefs.map.length; i++) {
                if (prefs.map[i] != null) {
                    document.formGet.preference.options[document.formGet.preference.options.length] = prefs.map[i];
            setCSSGenButtonVisibility();
        function OptionMap_add(key, value) {
            this.map[this.map.length] = new Option(value, key);
            this.map.length++;
        function OptionMap_remove (key) {
            if (key == null) return;       
            for (var i = 0; i < this.map.length; i++) {
                if (this.map[i] != null && this.map[i].value == key) {
                    this.map[i] = null;
                    break;
        //OptionMap object
        function OptionMap() {
            this.map = new Array();
        OptionMap.prototype.add = OptionMap_add;
        OptionMap.prototype.remove = OptionMap_remove;   
        function init() {
            generatePrefs();
    </script>
    </head>
    <body onload="init();">
    <div class="crumb">
        <h2><a href="home.jsp" target="mainFrame">Home</a> &gt; Test forms</h2>
    </div>
    <div class="title">
        <h3>Test Form Designs</h3>
    </div>
    <form method="get" id="formGet" name="formGet" action="GetFormServlet">
        <input type="hidden" id="clientType" name="clientType" />
        <input type="hidden" id="actionType" name="actionType" />
        <div class="formTopLevelContainer">
            <div class="subTitleLevel1">File selection</div>
            <div class="formContainerLevel1">
                <span class="instruction">Select a form design and a data file(optional) to render.</span>
                <span class="indent2">
                <span class="formRowFloat">
                    <span class="label3"><label for="dataName">Data files (optional)</label></span>
                    <span class="field3">
                        <select size="15%" name="dataName" id="dataName" class="fieldtext">
                            <option value="None" selected="selected">None</option>
                            <% for (int i=0; i < dataFiles.length; i++) {
                                      if (dataFiles[i] == null)
                                          break;
                                    if (dataFiles[i].indexOf(".xml") >= 0 ||
                                        dataFiles[i].indexOf(".pdf") >= 0 ||
                                        dataFiles[i].indexOf(".fdf") >= 0 ||
                                        dataFiles[i].indexOf(".xfdf") >= 0 ||
                                        dataFiles[i].indexOf(".xdp") >= 0)
                                    { %>
                            <option value="<%=dataFiles[i]%>"><%=dataFiles[i]%></option>
                            <% } %> <% } %>
                        </select>
                    </span>
                </span>
                <span class="formRowFloat">
                    <span class="label3">Form designs
                             <a href="#" title="Ascending Sort Templates" onclick="sortSelect(0);"><img src='images/ascending.gif' border='0'></a>
                          <a href="#" title="Descending Sort Templates" onclick="sortSelect(1);"><img src='images/descending.gif' border='0'></a>
                                Alphabetic Sort<input type='checkbox' id='alphabeticSortCheckbox'>
                    </span>
                    <span class="field3">
                        <select size="15%" name="formName" id="formName" class="fieldtext" onchange="generatePrefs()">
                            <option value=''></option>
                        </select>
                    </span>
                </span>
                </span>
            </div>
            <div class="subTitleLevel1">Output format selection</div>
            <div class="formContainerLevel1">
                <input type="hidden" id="GenerateCSS" name="GenerateCSS" value="0"/>
                <div class="instruction">Select the output format of the rendered form.</div>
                <div class="formRow">
                    <div class="label"><label for="preference">Output format:</label></div>
                    <div class="field">
                        <select id="preference" name="preference" onchange="setCSSGenButtonVisibility()">
                            <option selected value="REACH">Auto Detect HTML</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="subTitleLevel1">Issue request</div>
            <div class="formContainerLevel1">
                <span class="instruction">Render the form by selecting one of the following methods.</span>
                <span class="formRow">
                    <span class="label"><label for="viaEJB"></label></span>
                    <span class="field">
                        <span><input type="button" name="EJB" class="button" value="Use EJB" title="EJB" onclick="getForm('GetFormServlet',App.CLIENT_EJB)" /> </span>
                        <span><input type="button" name="Web Service" class="button" value="Use WebService" title="Web Service" onclick="getForm('GetFormServlet',App.CLIENT_SOAP)" /></span>       
                        <% if (bShowPlatform)
                        { %>           
                            <span><input type="button" name="viaPlatform" class="button" value="Platform" title="Platform" onclick="getForm('GetFormServlet',App.CLIENT_PLATFORM)" /> </span>
                            <span><input type="button" name="viaPlatformSOAP" class="button" value="Platform WebService" title="Platform WebService" onclick="getForm('GetFormServlet',App.CLIENT_PLATFORM_SOAP)" /> </span>
                        <% } %>
                    </span>
                </span>
                <span class="formRow">
                    <span class="label">Request Options:</span>
                    <span class="field">           
                    <span class="fieldGroup">
                        <input name="runPerf" type="checkbox" class="checkRadio" id="runPerfCheck" value="true"/>
                        <span class="checkRadioText"><label for="runPerfCheck">Enable performance test</label></span>
                    </span>                               
                    </span>
                </span>
                <span class="instruction"><b>Note:</b> When a rendered result is returned, submissions from it will cause the
                submitted data to appear in the data directory (provided it is a writable
                location). That data could then be used in subsequent operations.</span>
                <div id="CSSGenButton">
                    <br/>
                    <div class="instruction">Generate CSS button generates the CSS file for the selected form design. This CSS file can be used as a template for supplying custom styles for the selected form design.</div>
                    <span class="label"><label for="genCSS"></label></span><div><input type="button" value="Generate CSS" onclick="issueCSSGeneration('GetFormServlet')" /> </div>
                </div>
            </div>
        </div>
    </form>
        <script type="text/javascript">
            // declare javascript custom object and array to hold template info
            function Template(name, modified, formattedDate){
                this.name = name;
                this.modified = modified;
                this.formattedDate = formattedDate;
            } // end fx
            var templatesArray = new Array();<%
            File f = null;
            for (int i=0; i < files.length; i++) {
                // create local var
                f = files[i];
                // create javascript element
                out.println("templatesArray["+i+"] = new Template('" + f.getName() + "','" + f.lastModified() + "','" + new Date(f.lastModified()) + "');");
            }%>
            function populateTemplatesDropDown() {
                var selectToPopulate = document.getElementById('formName');
                selectToPopulate.options.length = 0;
                var optObj;           
                for(var i=0; i < templatesArray.length; i++) {
                    var template = templatesArray[i];
                    optObj = document.createElement('option');
              optObj.text = template.name;
              optObj.value = template.name;
              optObj.title = template.formattedDate;
              selectToPopulate.options.add(optObj);
            templatesArray.sort(sortModifiedDescendingHandler);
            populateTemplatesDropDown();
            function sortSelect(direction) {
                // 0 = ascending
                // 1 = descending
                if (document.getElementById('alphabeticSortCheckbox').checked) {
                    if (direction == 0) {
                        templatesArray.sort(sortNameAscendingHandler);
                    } else {
                        templatesArray.sort(sortNameDescendingHandler);                           
                } else {               
                    if (direction == 0) {
                        templatesArray.sort(sortModifiedAscendingHandler);
                    } else {
                        templatesArray.sort(sortModifiedDescendingHandler);
                populateTemplatesDropDown();
            function sortNameAscendingHandler(thisObject,thatObject) {   
                if (thisObject.name.toUpperCase() > thatObject.name.toUpperCase())    {       
                    return 1;   
                }    else if (thisObject.name.toUpperCase() < thatObject.name.toUpperCase())    {
                    return -1;
                return 0;
            function sortNameDescendingHandler(thisObject,thatObject) {   
                if (thisObject.name.toUpperCase() > thatObject.name.toUpperCase())    {
                    return -1;
                }    else if (thisObject.name.toUpperCase() < thatObject.name.toUpperCase())    {
                    return 1;
                return 0;
             function sortModifiedAscendingHandler(thisObject,thatObject) {   
                if (thisObject.modified > thatObject.modified)    {       
                    return 1;   
                }    else if (thisObject.modified < thatObject.modified)    {
                    return -1;
                return 0;
            function sortModifiedDescendingHandler(thisObject,thatObject) {   
                if (thisObject.modified > thatObject.modified)    {
                    return -1;
                }    else if (thisObject.modified < thatObject.modified)    {
                    return 1;
                return 0;
        </script>
    </body>
    </html>

  • Web form spam continued . . .

    HI, I have tried adding a hidden field to my web form to help reduce spam. I am not sure what I tried will work and do I need to and how do I add some code to specify do not process form if this field is filled in?
    Here is what I tried so far and any help would be awesome - Thanks Jim
    <!--- rest of form above--->
    <div style="display:none; visibility:hidden;">
         <label for="contact_email">Please leave this field blank:</label>
         <cfinput type="text" name="contact_email">
    </div>
    <div class="register">             
                <cfinput type="submit" name="submit" value="Register">
                <cfinput type="reset" name="Reset " value="Reset Form">         
    </div>
                   </fieldset>
    </cfform>

    I cannot see how anything you've said or done so far will help reduce web-form spam. Assuming you wish to prevent someone from maliciously submitting a form 10000 times to your site, then you have to use a CAPTCHA.
    There is no easy, 1-2-3 way to add CAPTCHA to your application. However, some ways are easier than others. I would recommend Raymond Camden's Quick and dirty CAPTCHA Guide - for ColdFusion 8. It uses Coldfusion 8's in-built CAPTCHA functionality, and is relatively easy to adopt.

Maybe you are looking for

  • Error while sorting in combination with xdofx in rtf template

    I'm trying to sort my invoices in a rtf/xml template. To do so I used a statement I found on google: <?sort:xdofx:lpad(H_FACTUUR_NR,15,'0')?> The error is: java.lang.reflect.InvocationTargetException      at sun.reflect.NativeMethodAccessorImpl.invok

  • Java in Safari but not in Firefox

    Dear Forum I have Java running in Safari, but the java.com test does not pass when I try to do it in Firefox. What can be wrong? What can i do? I require Firefox because I need the Firebug plugin. Thanks for any feedback.

  • Just Paid for CC, Installed Premier, But It's Trial... Why?

    First thing I did was to download Photoshop, which works fine. Then I downloaded Premier, which started in trial mode. Why is this? How can I solve this?

  • Latest java plug-in

    I'm trying to play monopoly on pogo.com and they keep asking for me to update my java plug-in... i have the latest version and it still keeps asking me to update it... what do I do?

  • Information Disbursements workflow

    Hi, I am currently working for a client who is into Financial Services. I need help on CML workflows. Could you kindly tell me if there is a standard SAP workflow (already available) for Loan Disbursements? If there is a standard workflow, could you