14 Replies Latest reply on Jun 17, 2014 6:52 AM by usbPOT

    unmanageable form

    usbPOT Level 1

      hi..

      our web designer is on leave and i told my boss i can update the web pages he has been working on, it seems however that i have bitten more than I can chew. The task is to add a question below the message box and the form has become unruly.

      http://www.skillsjunction.co.za

        • 1. Re: unmanageable form
          MurraySummers Level 8

          Where is the form?

          • 3. Re: unmanageable form
            MurraySummers Level 8

            What do you want to add to the form, and why do you say it has become unruly?

            • 4. Re: unmanageable form
              usbPOT Level 1

              I don't want the question to wrap, I want it to run single line and to align correctly.

              • 5. Re: unmanageable form
                MurraySummers Level 8

                Try replacing this -

                 

                        </li>

                       </ol>

                   

                       <fieldset>

                       <ol>

                        <li>

                        <label for="subscribe">Do you want to receive our newsletter</label>

                        <input name="subscribe" type="checkbox" value="subscribe" />

                        </li>

                          </ol>

                 

                with this -

                 

                        </li>

                        <li style="margin-top:25px;">

                        <label for="subscribe" style="width:250px;">Do you want to receive our newsletter</label>

                        <input name="subscribe" type="checkbox" value="subscribe" />

                        </li>

                          </ol>

                • 6. Re: unmanageable form
                  MurraySummers Level 8

                  You will also need to add the required processing scripting to the enquire.php file in order to manage this checkbox value. I suspect that this, too, may be too advanced for you.

                  • 7. Re: unmanageable form
                    usbPOT Level 1

                    Thank you.. for some reason the form-wrapper does not wrap around the form elements.. what could be the reason.

                    I have studied the php script  and yes i just could not figure out how to include a checkbox.

                    • 8. Re: unmanageable form
                      MurraySummers Level 8

                      In addition to the changes I gave you earlier, change this -

                       

                      #enquiry-form {

                      display: block;

                      color: #000;

                      background-color: #AA1F7A;

                      }

                       

                      to this -

                       

                      #enquiry-form {

                      display: block;

                      color: #000;

                      background-color: #AA1F7A;

                      padding-bottom:15px;

                      }

                      • 9. Re: unmanageable form
                        MurraySummers Level 8

                        We would need to see the PHP scripting to help you with the processing of the form data.

                        • 10. Re: unmanageable form
                          usbPOT Level 1

                          Thank you for your patience. i have uploaded the form after effecting the changes it is coming fine. However I would like to align the question with the other form items and remove the space at the top of the first form item.

                          • 11. Re: unmanageable form
                            usbPOT Level 1

                            I have done my part and managed to fix the form, it might not pass the scrutiny of purists but it will do the job.

                             

                            the php script

                            <?php

                            $errors = '';

                            $myemail = 'info@skillsjunction.co.za';//<-----Put Your email address here.

                            if(empty($_POST['name'])  ||

                               empty($_POST['company']) ||

                               empty($_POST['email']) ||

                               empty($_POST['telephone']) ||

                               empty($_POST['message']))

                            {

                                $errors .= "\n Error: all fields are required";

                            }

                             

                             

                            $name = $_POST['name'];

                            $company = $_POST['company'];

                            $email = $_POST['email'];

                            $telephone = $_POST['telephone'];

                            $message = $_POST['message'];

                             

                             

                            if (!preg_match(

                            "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",

                            $email))

                            {

                                $errors .= "\n Error: Invalid email address";

                            }

                             

                             

                            if( empty($errors))

                            {

                              $to = $myemail;

                              $email_subject = "Customer Enquiry";

                              $email_body = "The customer information and enquiry is as follows: ".

                              "\n\n Name: $name \n Company: $company \n Email: $email \n Telephone: $telephone \n Message: $message";

                             

                              $headers = "From: $myemail\n";

                              $headers .= "Reply-To: $email";

                             

                              mail($to,$email_subject,$email_body,$headers);

                              //redirect to the 'thank you' page

                              header('Location: thanks.htm');

                            }

                            ?>

                            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

                            <html>

                            <head>

                              <title>Contact form handler</title>

                            </head>

                             

                             

                            <body>

                            <!-- This page is displayed only if there is some error -->

                            <?php

                            echo nl2br($errors);

                            ?>

                             

                             

                             

                             

                            </body>

                            </html>

                            • 12. Re: unmanageable form
                              MurraySummers Level 8

                              Your script would be this -

                               

                              <?php

                              $errors = '';

                              $myemail = 'info@skillsjunction.co.za';//<-----Put Your email address here.

                              if(empty($_POST['name'])  ||

                                 empty($_POST['company']) ||

                                 empty($_POST['email']) ||

                                 empty($_POST['telephone']) ||

                                 empty($_POST['message']))

                              {

                                  $errors .= "\n Error: all fields are required";

                              }

                               

                               

                              $name = $_POST['name'];

                              $company = $_POST['company'];

                              $email = $_POST['email'];

                              $telephone = $_POST['telephone'];

                              $message = $_POST['message'];

                              $subscribe = isset($_POST['subscribe'])?$_POST['subscribe']:'';

                               

                               

                              if (!preg_match(

                              "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",

                              $email))

                              {

                                  $errors .= "\n Error: Invalid email address";

                              }

                               

                               

                              if( empty($errors))

                              {

                                $to = $myemail;

                                $email_subject = "Customer Enquiry";

                                $email_body = "The customer information and enquiry is as follows: ".

                                "\n\n Name: $name \n Company: $company \n Email: $email \n Telephone: $telephone \n Message: $message";

                                $email_body .= $subscribe?"\n Subscribe: Yes":"";

                                $headers = "From: $myemail\n";

                                $headers .= "Reply-To: $email";

                               

                                mail($to,$email_subject,$email_body,$headers);

                                //redirect to the 'thank you' page

                                header('Location: thanks.htm');

                              }

                              ?>

                              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

                              <html>

                              <head>

                                <title>Contact form handler</title>

                              </head>

                               

                               

                              <body>

                              <!-- This page is displayed only if there is some error -->

                              <?php

                              echo nl2br($errors);

                              ?>

                               

                               

                               

                               

                              </body>

                              </html>

                              • 13. Re: unmanageable form
                                MurraySummers Level 8

                                The space at the top of the first form item is due to this CSS -

                                 

                                .form-bg {

                                width: 550px;

                                background-color: #FFF;

                                margin-top: 25px;

                                padding-top: 25px;

                                }

                                 

                                Adjust that padding value to suit.

                                 

                                How would you like the checkbox and its label to align, specifically?

                                • 14. Re: unmanageable form
                                  usbPOT Level 1

                                  I have managed to align the label to my satisfaction.. thank you

                                   

                                  Kind Regards