Page forms disappear

A

Anonymous

Guest
Nope, but intermingling HTML and PHP, plus using inline JavaScript and no formatting (The major problem) of the code is confusing as can be. :eek:

I just got a headache looking at the code. :(
Sorry for being so blunt, but in my opinion it is always best to be honest.
 
Here are a few examples that will give you an idea what I'm trying to say
Code:
<form id="registerPage" action="registerPage.php" method="post">
    <fieldset>
        <legend>Registration Form</legend>
        <label for="username">username</label>
        <input id="username" type="text" name="data[username]" value="<?php echo (isset($data) && $status['duplicate']) ? $data['username'] : NULL; ?>">
        <label>password</label>
        <input type="password" name="data[password]">
        <label>confirm password</label>
        <input type="password" name="data[verify]">
        <label>first name</label>
        <input type="text" name="data[first_name]" value="<?php echo (isset($data['first_name']) && $data['first_name']) ? $data['first_name'] : NULL; ?>">
        <label>last name</label>
        <input type="text" name="data[last_name]" value="<?php echo (isset($data['last_name']) && $data['last_name']) ? $data['last_name'] : NULL; ?>">
        <label>email address</label>
        <input type="text" name="data[emailAddress]" value="<?php echo (isset($data['emailAddress']) && $status['validEmail']) ? $data['emailAddress'] : NULL; ?>">
        <input type="submit" name="submit" value="register">
    </fieldset>
</form>
Code:
    <form id="contact" action="<?php echo $basename; ?>" method="post">
        <fieldset>
            <legend><?php echo isset($success) ? $success : 'Contact Form'; ?></legend>
            <label for="first_name">First Name</label>
            <input id="first_name" type="text" name="first_name" value="">
            <label for="last_name">Last Name</label>
            <input id="last_name" type="text" name="last_name" value="">
            <label for="email">Email Address</label>
            <input id="email" type="email" name="email" value="">
            <div id="subject">
                <label  for="subjectInput">Leave blank</label>
                <input type="text" name="subject" id="subjectInput" autocomplete="off">
            </div>
            <script>
                (function () {
                    var e = document.getElementById("subject");
                    e.parentNode.removeChild(e);
                })();
            </script>   
            <hr class="contactLine">
            <div class="radioBlock">
                <input type="radio" id="radio1" name="reason" value="message" checked>
                <label class="radioStyle" for="radio1">comment</label>
                <input type="radio" id="radio2" name="reason" value="price">
                <label class="radioStyle" for="radio2">pricing</label>  
                <input type="radio" id="radio3" name="reason" value="order">
                <label class="radioStyle" for="radio3">order info</label>    
            </div>

            <label class="textareaLabel" for="message">Message</label>
            <textarea id="message" name="comment" placeholder="Enter message here..."></textarea>
            <input type="submit" name="submit" value="submit">
        </fieldset>
    </form>

Yeah, I know there's PHP and JavaScript intermingle, but sometimes it's unavoidable and that might be the case with your form. However, it's hard to tell with no formatting going on.
 
Back
Top