Jump to content

Table help please :/


Noskiw

Recommended Posts

This is my code

 

<?php

    if(isset($_REQUEST['message'])){
        $to = 'noskiw@blackberry.orange.co.uk';
        $subject = "Contact Form";
        $message = "From: " . $_REQUEST['name'];
        $message.= "Email: " . $_REQUEST['email'];
        $message.= "Message: " . $_REQUEST['message'];
        
        $header = "From: Noskiw!";
        
        if(mail($to, $subject, $message, $header)){
            echo "Your Message has been sent!";
        }else{
            echo "There was a problem sending your message";
        }
        
        die();
        
    }

?>

<html>

    <head>

        <title>Jquery Ajax Form</title>
        <link href="./csss.css" type="text/css" rel="stylesheet" />
        <script type="text/javascript" src="./jquery.js"></script>
        <script type="text/javascript">

            $(document).ready(function(){
                $('#contactForm').submit(function(){
        
                    var inputs = [];
                    $(':input', this).each(function(){
                        inputs.push(this.name + '=' + escape(this.value));
                    });
        
                jQuery.ajax({
                    data: inputs.join('&'),
                    url: this.action,
                    timeout: 2000,
                    error: function(){
                        console.log("Failed to submit");
                    },
                    success: function(r){
                        alert(r);
                        document.getElementById("contactForm").reset();
                    }
                });
        
            return false;
        
            });
        });

    </script>

    </head>

    <body>

        <div class="container" style="margin: none;">

            <div id="content_text">

                <h1>jQuery Ajax Forms</h1>

                <form action="contact.php" method="get" id="contactForm">
                
                    <table align="top" cellpadding="3" cellspacing="3" border="0">
                    
                        <tr>
                            <td>Email: </td>
                            <td>
                                <input type="text" name="email" value="" id="email" style="border: 1px solid #000" />
                            </td>
                        </tr>
                        <br />
                        <tr>
                            <td>Name: </td>
                            <td>
                                <input type="text" name="name" value="" id="name"  style="border: 1px solid #000" />
                            </td>
                        </tr>
                        <br />
                        <tr>
                            <td>Message: </td>
                            <td>    
                                <textarea name="message" id="message" style="border: 1px solid #000"></textarea>
                            </td>
                        </tr>
                        <br />
                        <tr>
                            <td align="right" colspan="2">
                                <input type="submit" value="Send Message" style="border: 1px solid #000" />
                            </td>
                        </tr>
                        
                    </table>
                    
                </form>

            </div>

        </div>

    </body>

</html>

 

There is a huge white space right above the table, is there anyway that I could get rid of this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.