Results 1 to 4 of 4

Thread: How can I change success message font size on Bootstrap Contact form?

  1. #1
    Join Date
    Jan 2009
    Location
    NH
    Posts
    631
    Thanks
    96
    Thanked 24 Times in 24 Posts

    Question How can I change success message font size on Bootstrap Contact form?

    On this page http://newfieldshome.com/contact.html I am using a responsive contact form I saw for Bootstrap. When you submit it gives you a success message from the contact.php page.
    Code:
    $okMessage = 'Contact form successfully submitted. Thank you, I will get back to you soon!
    How can I make that message larger? This is from the contact.php page

    PHP Code:
    <?php

    // configure
    $from 'contact form <John@SamonasGroup.com>';
    $sendTo 'contact form <John@SamonasGroup.com>';
    $subject 'New message from contact form';
    $fields = array('name' => 'Name''surname' => 'Surname''phone' => 'Phone''email' => 'Email''message' => 'Message'); // array variable name => Text to appear in the email
    $okMessage 'Contact form successfully submitted. Thank you, I will get back to you soon!';
    $errorMessage 'There was an error while submitting the form. Please try again later';

    // let's do the sending

    try
    {
        
    $emailText "You have new message from contact form\n=============================\n";

        foreach (
    $_POST as $key => $value) {

            if (isset(
    $fields[$key])) {
                
    $emailText .= "$fields[$key]$value\n";
            }
        }

        
    $headers = array('Content-Type: text/html; charset="UTF-8";',
            
    'From: ' $from,
            
    'Reply-To: ' $from,
            
    'Return-Path: ' $from,
        );
        
        
    mail($sendTo$subject$emailTextimplode("\n"$headers));

        
    $responseArray = array('type' => 'success''message' => $okMessage);
    }
    catch (\
    Exception $e)
    {
        
    $responseArray = array('type' => 'danger''message' => $errorMessage);
    }

    if (!empty(
    $_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
        
    $encoded json_encode($responseArray);

        
    header('Content-Type: application/json');

        echo 
    $encoded;
    }
    else {
        echo 
    $responseArray['message'];
    }
    this is the custom css page if you need it http://www.newfieldshome.com/css/custom.css

  2. #2
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    432
    Thanks
    0
    Thanked 54 Times in 50 Posts

    Default

    That is just a text message echoed to the browser. If you want to style it you will have to enclose in an HTML page so that you can add styling.

  3. #3
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    432
    Thanks
    0
    Thanked 54 Times in 50 Posts

    Default

    Replace the last three lines of your PHP file with this:

    Code:
    else { 
        echo '<!doctype html><html lang="en"><head><title>Response page</title>';
        echo '<style> .myStyle { /* Your styling goes in here */ }</style>';
        echo '</head><body>';
        echo '<p class="myStyle">'.$responseArray['message'].'</p>';
        echo '</body></html>';
    }
    ?>

  4. The Following User Says Thank You to styxlawyer For This Useful Post:

    mlegg (02-21-2017)

  5. #4
    Join Date
    Jan 2009
    Location
    NH
    Posts
    631
    Thanks
    96
    Thanked 24 Times in 24 Posts

    Default

    Thank you

Similar Threads

  1. Replies: 0
    Last Post: 09-26-2014, 11:58 PM
  2. Replies: 2
    Last Post: 06-08-2012, 03:07 PM
  3. Question about an error message on contact form
    By windbrand in forum JavaScript
    Replies: 1
    Last Post: 01-05-2012, 05:42 PM
  4. Change menu font size
    By dmyoungsal in forum CSS
    Replies: 1
    Last Post: 03-22-2010, 08:11 PM
  5. How do I change, Font, Color, and Size of text
    By janda@myjanda.com in forum HTML
    Replies: 6
    Last Post: 10-18-2004, 03:49 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •