Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    4
    Member #
    29559
    I have a similar problem (I think). I have a contact form here:

    http://www.lawmoye.com/my_contact.php

    A friend of mine set up the PHP for it. The interesting thing is that he basically put a "clear:both" after each text box. If you remove the "clear:both" after each text box, the text boxes all run into each other. I have posted the code here:

    The CSS code is in a separate CSS file and it says:

    .clear {
    clear:both;

    <?php

    if($_POST['consub']){
    if(trim($_POST['first_name'])=='') $msg ='You must enter a First Name to contact us.';
    if(trim($_POST['email'])=='') $msg ='You must enter an Email Address or we won&#39;t be able to contact you.';
    if(trim($_POST['message'])=='') $msg ='You must enter a message to contact us.';
    if(!$msg){
    foreach($_POST as $k=>$v){
    $_POST[$k]=mysql_real_escape_string(trim($v));
    }

    $name = $_POST['first_name'].' '.$_POST['last_name'];
    $email = $_POST['email'];
    $address = $_POST['address'].' '.$_POST['city'].', '.$_POST['state'].' '.$_POST['zip'];
    $message = $_POST['message'];
    $mailmsg = "LawMoye Contact Form Submission:\n\n".
    "Submitted By: ".$name."\n".
    "Email Address: ".$email."\n".
    "Address: \n".$address."\n\n".
    "Message:\n".$message."\n\n";

    }
    }
    $clear='<div class="clear"></div>';
    if($msg) $msg = '<div class="errorbox" style="width:250px;">'.$msg.'</div>';
    $contactform='<div id="contactdisplay">
    <form action="" method="post" id="conform">
    '.($msg?$msg:'Fill out the form to contact our staff.<br />').'
    <div class="c_title">First Name:</div><input class="c_txt" type="text" size="25" name="first_name" value="'.$_POST['first_name'].'" />'.$clear.'
    <div class="c_title">Last Name:</div><input class="c_txt" type="text" size="25" name="last_name" value="'.$_POST['last_name'].'" />'.$clear.'

    The rest of the text boxes look exactly like the Last Name text box above.

    Then it ends with the following:

    Message:<br />
    <textarea name="message" rows="4" cols="40"></textarea><br />
    <input type="submit" name="consub" value="Submit" />
    </form>
    '.$clear.'
    </div>';

    echo $contactform;

    ?>

    I know that there's something wrong with clearing the divs. The content area is obviously pushing down everything that follows the first clear. Basically, the div on the right is being pushed down by the content on the left. If you click the slider on the left side of the navigation menu, you will find that the content in the form moves up and down when the navigation moves up and down. I have cleared everything in every way possible and now I'm just stuck...

    Any help would be greatly appreciated. I contacted my friend for help but he just started a new job and has been tough to catch...

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:24 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com