Jump to content

Recommended Posts

I have this form, but it doesn't seem to submit when I click the button.

I do have if(isset($_POST['submit'])){ when I validate the form too.

Does anyone know why?

<table width="72%" border="0">
    <form action="" method="post" onSubmit="rememberinput('forename', 'surname', 'email')">      
      <tr height="37">
      <td width="16%">Full Name<?php echo $error['name'];?></td>
      <td width="44%"><input type="text" name="forename" id="name" value="forenames"
      onfocus="if(this.value=='forenames'){this.value='';}" 
      onblur="if(this.value==''){this.value='forenames';}" 
      onclick="document.getElementById('hint1').style.display = '';
      document.getElementById('hint2').style.display = 'none';
      document.getElementById('hint3').style.display = 'none';
      document.getElementById('hint4').style.display = 'none';
      document.getElementById('hint5').style.display = 'none';"/> 
      <input type="text" name="surname" id="surname" value="surname"
      onfocus="if(this.value=='surname'){this.value='';}" 
      onblur="if(this.value==''){this.value='surname';}"
      onclick="document.getElementById('hint1').style.display = '';
      document.getElementById('hint2').style.display = 'none';
      document.getElementById('hint3').style.display = 'none';
      document.getElementById('hint4').style.display = 'none';
      document.getElementById('hint5').style.display = 'none';"/></td>
      <td width="40%">
      <span id="hint1" style="display:none">Your Full Name.<span class="hint-pointer"> </span></span><br /></td>
      </tr>
      
      <tr height="37">
      <td>Your Email Address<?php echo $error['email'];?></td>
      <td><input name="email" type="text" id="email" value="<?php echo $_POST['email']; ?>"
      onclick="document.getElementById('hint1').style.display = 'none';
      document.getElementById('hint2').style.display = '';
      document.getElementById('hint3').style.display = 'none';
      document.getElementById('hint4').style.display = 'none';
      document.getElementById('hint5').style.display = 'none';" size="46"/></td>
      <td><span id="hint2" style="display:none">Your Email Address.<span class="hint-pointer"> </span></span><br /></td>
      </tr>
      
      <tr>
      <td>Message<?php echo $error['message'];?></td>
      <td><textarea name="message" cols="50" rows="9" class="textBox" id="message"
      onclick="document.getElementById('hint1').style.display = 'none';
      document.getElementById('hint2').style.display = 'none';
      document.getElementById('hint3').style.display = '';
      document.getElementById('hint4').style.display = 'none';
      document.getElementById('hint5').style.display = 'none';" value="<?php echo $_POST['message']; ?>"></textarea></td>
      <td><span id="hint3" style="display:none">Type the message you wish to display. Minimum 10 characters.<span class="hint-pointer"> </span></span><br /><br /><br /><br /><br /><br /><br /></td>
      </tr>
      <tr>
      <td><span style="width:149px;"><img src="pngimg.php" alt="" width="148" height="30" style="border:1px solid #448DC4;" name="captcha"/><br />
        <center><a href="#" onclick="Start();">Refresh</a> <strong>/</strong> <a href="#" onmouseover="document.getElementById('tip').style.display='';" 
      onmouseout="document.getElementById('tip').style.display='none';">Whats this?</a></center></span></td>
      <td><div style="width:149px;"><span id="tip" style="margin-left:10px; margin-top:3px; display:none">
        Captcha's are to prevent Bots from accessing our website. This field is to prevent spam
        </span>
      The answer is:
      <input name="captcha2" class="textBox" id="captcha" size="5" maxlength="2" 
      onclick="document.getElementById('hint1').style.display = 'none';
      document.getElementById('hint2').style.display = 'none';
      document.getElementById('hint3').style.display = 'none';"/>
      </div>
        <span style="width:149px;"><?php echo $error['captcha']; ?></span></td>
      <td><span id="tip1" style="margin-left:120px; margin-top:3px; display:none">
      Like the captcha field, this field is to prevent bots from accessing our website.
      </span></td>
      </tr>
      
      <tr height="37">
      <td> </td>
      <td><input name="submit" type="button" value="submit"/></td>
      <td> </td>
      </tr>
    </form>
    </table>

[/code]

Link to comment
https://forums.phpfreaks.com/topic/187042-why-dont-this-form-submit/
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.