adding two functions to one button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

adding two functions to one button

Post by jonnyfortis »

I have a form that has one submit button and one tick box.

submit button sends you to a new page (a lease)

currently if the tick box is not selected and you click the submit button it give an alert to say that you must tick the box to view the lease.

I need it that once you have ticked the box and submit it stores this information in a php sysql database ( i have set up already) and directs you to the lease

here is what i have already

Code: Select all

<form action="section21.php?userid=<?php echo $row_Recordset1['userid']; ?>" method="post" name="form4" target="_new" id="form4">
        <div align="right"><span id="sprycheckbox4">
          <span class="body-text">Section 21 Notice</span><br />
          <input type="image" src="../images/smalldownload.png" width="35" height="35" alt="download" value="submit"/>
          </a>
          <input type="checkbox" name="21notice" id="21notice" />
        </span></div>
        <span id="sprycheckbox4">
        <label for="21notice2"></label>
        <div align="right"><br />
        </div>
        </span>
      </form>

<div id="ErrorZone2"><span class="checkboxRequiredMsg"><table width="400" border="1" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="400" border="0" cellspacing="10" cellpadding="0">
            <tr>
              <td><strong>Electronic Signature Agreement:</strong><br /></td>
              </tr>
            <tr>
              <td>Tenant (<?php echo $row_Recordset1['userid']; ?>) and Guarantor (<?php echo $row_Recordset1['GuName']; ?>) usernames <?php echo $row_Recordset1['userid']; ?></td>
              </tr>
            </table></td>
          </tr>
  </table>
</span></div><script type="text/javascript">
var sprycheckbox4 = new Spry.Widget.ValidationCheckbox("sprycheckbox4", {additionalError: 'ErrorZone2'});
</script>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: adding two functions to one button

Post by requinix »

You can use header to redirect to another page. See the documentation for an example.
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: adding two functions to one button

Post by jonnyfortis »

ok thanks will have a look at that


thanks again
Post Reply